/1.28 JailKit

--- JailKit ---

 

Running @ doc07  
sftp almasftp@doc07.cc.binghamton.edu

### On the server for initial install.
###https://olivier.sessink.nl/jailkit/
wget https://centostwo.binghamton.edu/Upload/jailkit-2.19.tar.gz
tar xvf jailkit-2.19.tar.gz
configure; make; make install

### initialise the jail
mkdir /home/sftproot
jk_init -j /home/sftproot jk_lsh
jk_init -j /home/sftproot sftp
jk_init -j /home/sftproot scp

### Create the account
adduser almasftp
passwd almasftp
ls -ld /home/almasftp/
chown almasftp:almasftp /home/almasftp/ ## if necessary!
jk_jailuser -j /home/sftproot almasftp

### Edit the jk_lsh configfile in the jail (man jk_lsh)
cp -p /home/sftproot/etc/jailkit/jk_lsh.ini /home/sftproot/etc/jailkit/00.jk_lsh.ini
vi /home/sftproot/etc/jailkit/jk_lsh.ini
    [almasftp]
    paths= /usr/lib/,/usr/bin/
    executables= /usr/libexec/openssh/sftp-server, /usr/bin/scp
 
    grep sftp-server /etc/ssh/sshd_config |awk '{print $3} ### will find path to stp-server

### now restart jk_socketd
killall jk_socketd; jk_socketd

### Tail the log (messages or authlog)
tail -f /var/log/messages

#### Test the almasftp account on a remote sever that has access
sftp almasftp@`ifconfig -a |egrep 128.226 |awk '{print $2}'`

### SSH-key additions can be done now
mkdir .ssh
chown almasftp:almasftp .ssh
chmod 700 .ssh
cd .ssh

### Create, add to, or mod authorized_keys
###   The file know_hosts doesn't seem to need to exist in the
###   user .ssh dir...the /root/.ssh/know_hosts might cover it.

### Add addtional users starting at ### Create the account


Valid HTML 4.01!

--swish-e search words alma sftp