Nov 21
If you have a server, but only want to allow users to copy files via sFTP without providing shell access. This can be done with rssh, a restricted shell for use with OpenSSH that allows only scp and/or sftp.
To install rssh
$ apt-get install rssh
By default rssh doesn’t allow anything, to allow only sftp modify the rssh.conf file.
$ nano /etc/rssh.conf
Uncomment the line for allowsftp and other transfer protocols you want to enable.
#allowscp
allowsftp
#allowcvs
#allowrdist
#allowrsync
To restrict a user to only allow sftp access, modify the /etc/passwd file
$ nano /etc/passwd
For example
ftp:x:100:100::/home/ftp:/usr/bin/rssh
Related posts: