Tuesday, June 15, 2010

SFTP Server Configuration with Jail kit

jk_addjailuser -c “chaitanya|testuser|chaitanya_yalamanchili@mindtree.com|suma|test_sftp|06-06-2010|20-06-2010|” -g chaitanya

jk_addjailuser -c "M1011646|testuser|test_user@mindtree.com||24-May-2010|31-May-2011" -g testuser testuser


jk_addjailuser -c “|chaitanya|chaitanya_yalamanchili@mindtree.com|suma|test_sftp|06-06-2010|20-06-2010|” -g chaitany



./configure
make
make install

cp extra/jailkit /etc/init.d/jailkit
chmod a+x /etc/init.d/jailkit


mkdir /sftp

jk_init -j /sftp jk_lsh
jk_init -j /sftp sftp
jk_init -j /sftp scp

# create the account
adduser testftp

jk_jailuser -j /sftp testftp

# edit the jk_lsh configfile in the jail (man jk_lsh)

vim /sftp/etc/jailkit/jk_lsh.ini

[testuser]
paths= /usr/lib/
executables= /usr/libexec/openssh/sftp-server
allow_word_expansion =0
umask = 077


# now restart jk_socketd
/etc/init.d/jailkit restart
# test the account
sftp test@localhost
# check the logs if everything is correct
tail /var/log/daemon.log /var/log/auth.log

No comments:

Post a Comment