jailkit-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Jailkit-users] Unable to ssh in Centos8 (Connection to localhost closed


From: Andres
Subject: [Jailkit-users] Unable to ssh in Centos8 (Connection to localhost closed.)
Date: Thu, 8 Jul 2021 16:51:51 -0300

Hi guys!

I am experiencing strange problem under Centos 8  with Jailkit and SSH.
I am trying to limit a user to only be able in a chroot, with ssh, sftp. I want their default directory to be /home/jail. 
I followed the howto guide to try and just use jailkit here  (https://olivier.sessink.nl/jailkit/ )
At first I had a problem with  sftp but  after looking ..I found one solution of Oliver here ...(https://savannah.nongnu.org/bugs/?59732)

But now,  I can't connect by ssh but yes sftp.
I use jailkit many years ago ..I have installed it in Centos 7 without problem.
I have proved with with jailkit 2.22 and jailkit 2.17 in Centos8 and doesn't work.
I want to share with you different files of configuration of jailikit 2.20 in Centos8:

[root@localhost etc]# cat /etc/redhat-release  
CentOS Linux release 8.4.2105

[root@localhost etc]# ssh test@localhost
test@localhost's password:  
Last login: Thu Jul  8 08:45:31 2021 from 192.168.0.191
Connection to localhost closed.

[root@localhost etc]# sftp test@localhost
test@localhost's password:  
Connected to test@localhost.
sftp> 

[root@localhost etc]# pwd
[root@localhost etc]# pwd
/etc
[root@localhost etc]# cat passwd
test:x:1000:1000::/home/jail/./home/test:/usr/sbin/jk_chrootsh

[root@localhost jailkit]# pwd
/home/jail/etc/jailkit

[root@localhost jailkit]# cat jk_lsh.ini  
[test]
paths= /usr/bin, /usr/libexec/openssh/
executables= /usr/libexec/openssh/sftp-server, /usr/bin/bash

[root@localhost etc]# pwd
/home/jail/etc
[root@localhost etc]# cat passwd  
root:x:0:0:root:/root:/bin/bash
#test:x:1000:1000::/home/test:/usr/sbin/jk_lsh
test:x:1000:1000::/home/test:/bin/bash

[root@localhost jail]# cat /var/log/messages
Jul  8 15:14:32 localhost systemd[1]: Started Session 46 of user test.
Jul  8 15:14:32 localhost systemd-logind[881]: New session 46 of user test.
Jul  8 15:14:32 localhost jk_chrootsh[4088]: now entering jail /home/jail for user test (1000) with arguments
Jul  8 15:14:32 localhost systemd[1]: session-46.scope: Succeeded.
Jul  8 15:14:32 localhost systemd-logind[881]: Session 46 logged out. Waitingq for processes to exit.
Jul  8 15:14:32 localhost systemd-logind[881]: Removed session 46.


I appreciate any response or if the same has happened to someone!
Thanks so much for your help!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]