Browse - Computer Tips - How do I keep sftp users in their home directory?
Q. How do I keep sftp users in their home directory?
A. Use rssh. (restricted shell)
- Install the package the usual way: "dnf install rssh"
- You'll also want to download (but not install) the source
- Make a jail directory:
- Modify the user to use rssh and the jail directory.
So an example /etc/passwd entry would be:
- Modify /etc/rssh.conf (the configuration file)
- Uncomment this line:
- Set the following:
chrootpath = /usr/local/jail
- Make the jail.
sh /usr/local/src/rssh-VERSION/mkchroot.sh /usr/local/jail
- Make the user's home directories:
chown -R sftpguy.sftpguy /usr/local/home/sftpguy
- That's it
(Probably a virtual ftp user is better)