On a Ubuntu 11.04 server, I want to restrict a user to a specific directory (so he can't access the parents' directory) for FTP/ssh.
I created the user with adduser username
and changed the target directory with usermod -d /home/path/to/directory username
. This worked perfectly.
From what I found I have to modify a /etc/ftp/ftpaccess
file but the file (and the ftp) directory does not exist. I tried creating it but it didn't change anything. Also I only want to restrict this user and not the others.
Any ideas?
Best Answer
The best way, is to use SFTP from SSH and jail the user.
in file:
/etc/ssh/sshd_config
make sure this line is uncomented:
Then configure the rule to match a group:
and lastly manage the users:
Source: http://www.debian-administration.org/articles/590