Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject:
PostPosted: Tue Dec 21, 2010 1:45 pm 
Offline
Senior Member
User avatar

Joined: Sun Mar 23, 2008 10:10 am
Posts: 71
Website: http://frontseed.com/
AndrijaM wrote:
This is what I run:

sudo /usr/share/doc/scponly/setup_chroot/setup_chroot.sh from root. ...

That is, if you don't change to the directory before running the script, it will not be able to open config.h. Try this:
Code:
$ cd /usr/share/doc/scponly/setup_chroot
$ sudo ./setup_chroot.sh


Top
   
 Post subject:
PostPosted: Tue Dec 21, 2010 2:17 pm 
Offline
Senior Member

Joined: Thu Mar 11, 2010 1:09 pm
Posts: 62
Nothing again :(

I did $ cd /usr/share/doc/scponly/setup_chroot

and from there sudo setup_chroot.sh with and without ./ and now says

sudo: setup_chroot.sh: command not found


Top
   
 Post subject:
PostPosted: Tue Dec 21, 2010 2:39 pm 
Offline
Senior Member
User avatar

Joined: Sun Mar 23, 2008 10:10 am
Posts: 71
Website: http://frontseed.com/
AndrijaM wrote:
Nothing again :(

I did $ cd /usr/share/doc/scponly/setup_chroot

and from there sudo setup_chroot.sh with and without ./ and now says

sudo: setup_chroot.sh: command not found

eeer... I hope you entered the commands without the '$' sign ;) My bad if those characters confused you.

Also check if setup_chroot.sh has executable permissions (e.g. sudo chmod 755 setup_chroot.sh if not)

Edit: just retracted my alternative suggestions.


Top
   
 Post subject:
PostPosted: Tue Dec 21, 2010 2:59 pm 
Offline
Senior Member

Joined: Thu Mar 11, 2010 1:09 pm
Posts: 62
Yes, without $ :D

setup_chroot.sh was 644 but I chmod it to 755 before.

But what's this ./ that you wrote sudo ./setup_chroot.sh
If i'm already in the right directory do I have to type ./ ?

I really don't get this, I know I'm in the right directory, when I type dir it list two files: config.h and setup_chroot.sh so everything is there, just sudo setup_chroot.sh says: command not found??

Am I misspelling the command somehow?


Top
   
 Post subject:
PostPosted: Tue Dec 21, 2010 3:19 pm 
Offline
Senior Member
User avatar

Joined: Sun Mar 23, 2008 10:10 am
Posts: 71
Website: http://frontseed.com/
If you run an executable without any path in the filename, the file being executed has to reside in a directory defined in your PATH environment variable. If you specify the path ./ before the filename (which means the current directory) it will not search the file in PATH (/bin, /usr/bin, etc.)
Alternatively you can run the script like this:
Code:
sudo sh setup_chroot.sh

This method does not require you to set the script as executable.
I hope this will finally resolve your issue.


Top
   
 Post subject:
PostPosted: Wed Dec 22, 2010 7:27 am 
Offline
Senior Member

Joined: Thu Mar 11, 2010 1:09 pm
Posts: 62
Melon, thanks a lot for helping me out.

sudo sh setup_chroot.sh

that was a winner :)

I was able to start the script, created a user, all went fine, BUT again I'm on the same position as in this thread, user is able to browse all server, he can go up, and see all other sites and file up to the top.

Plus, now I see, I can't write files anywhere on the server, I can only download files, I can't write even in the users home dir :(


Top
   
 Post subject:
PostPosted: Wed Dec 22, 2010 3:56 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
As a slightly different perspective - when i wanted a similar file transfer lock down in the past for remote updates to web content, I ended up using something other than openssh, in large part since I had an additional desire of not wanting the transfer accounts to have to exist on the system as actual users, so I could maintain them independently.

I found vsftpd to be very straight forward. It supports virtual accounts, so you can set up a PAM source that purely does authentication, easy to lock down accessible directories per user, and can configure such transfers to all use a single system account, like www-data, for file ownership. But it does mean that your clients will need to support FTPS rather than SFTP. Many transfer clients do, but it could be an issue.

Another alternative is proftpd, which is a bit more extensive, but can also support SFTP, in additional to multiple source options (including a SQL database) for virtual accounts.

In my case I mostly went with vsftpd after comparing the two since it had a simpler configuration to set up for my specific purposes, but I didn't have any particular issues with proftpd, so would have used it if I needed any of its features.

-- David


Top
   
 Post subject:
PostPosted: Fri Dec 24, 2010 3:27 pm 
Offline
Senior Member

Joined: Thu Mar 11, 2010 1:09 pm
Posts: 62
@david
thank you for your suggestion, I'm kind of newbie so it would be difficult for me to do what you said.
Luckily, I found an easyer solution
viewtopic.php?t=6437

@melon
thanks a lot :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group