Results 1 to 3 of 3
Newbie here.
I added a user named mike and I was able to change his home directory to var/www/mikeshome but when mike connects via sftp he starts in mikeshome directory ...
- 08-19-2009 #1Just Joined!
- Join Date
- Apr 2008
- Posts
- 4
Only allow user access to specific directory
Newbie here.
I added a user named mike and I was able to change his home directory to var/www/mikeshome but when mike connects via sftp he starts in mikeshome directory but is able to go up a directory as well. I want to make mike only have access to mikeshome and all of its sub directories. I am on a RED Hat 5 machine using putty.
Any help would be awesome.
Thanks!
- 08-19-2009 #2
You need to configure the sftp server (openssh) to chroot the user into /var/www/mike. I have never done this myself so can't offer specific details on how to do it, but take a look at the articles on this page and they may help.
- 08-19-2009 #3
Greetings... not as simple as chroot'ing a user in vsftp or proftpd (uncomment a line, add some names...).
LOL
Open the file /etc/ssh/sshd_config and then check for the lines:
or whatever matches your distro.Subsystem sftp /usr/lib/openssh/sftp-server
Then check and uncomment or add the lines:
for chroot by user, or else:Match User mike
ChrootDirectory /var/www/mikeshome
AllowTCPForwarding no
X11Forwarding no
ForceCommand /usr/lib/openssh/sftp-server
for chroot by group.Match Group mike
ChrootDirectory /var/www/mikeshome
AllowTCPForwarding no
X11Forwarding no
ForceCommand /usr/lib/openssh/sftp-server
Then restart the ssh server.
Good luck.Respectfully... Sarlac II
~~
The moving clock K' appears to K to run slow by the factor (1-v^2/c^2)^(1/2).
This is the phenomenon of time dilation.
The faster you run, the younger you look, to everyone but yourself.


Reply With Quote