Setting up chrooted sftp only account using scponly
8:19 PMWhat is scponly?
Scponly is a limited shell for allowing users to scp/sftp to a linux box. Addtionally, we can setup scponly to chroot the user into a particular directory increasing the level of security.How to install and set up a new chrooted sftp account using scponly?
- Download scponly pacakge from sourceforge:
wget http: //sourceforge.net/projects/scponly/files/latest/download?source=files |
- Untar and cd to it.
tar zxvf scponly- 20110526 .tgz ; cd scponly- 20110526 |
- Do a configure making use of chrooted binary so that user is chrooted to home directory
./configure --enable-chrooted-binary |
- Add the entry to /usr/local/sbin/scponlyc to /etc/shells.
- Let's create a new user jake (Ensure that user "jake" do not exist) using following command:
"make jail" |
It creates user, sets shell to /usr/local/sbin/scponlyc and copies relevant system files to
/home/jake/ to ensure user is chrooted.
- Also create a folder "dev" under /home/jake and and copy /dev/null as that is required for sftp to work.
mkdir /home/jake/dev cp -a /dev/ null and /home/jake/dev/ |
- Jake's upload directory is /home/jake/incoming.
as shown below:
mount --bind /usr/local/website/www_jake_com /home/jake/incoming |
0 comments