jailkit-users
[Top][All Lists]
Advanced

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

Re: [Jailkit-users] jk_lsh[7742]: cannot find user info for USER guest:


From: John Pilkington
Subject: Re: [Jailkit-users] jk_lsh[7742]: cannot find user info for USER guest: Success (2)
Date: Fri, 14 Dec 2018 14:59:25 +0000

Thank you so much for your quick reply, Olivier. I have checked; there was a linefeed at the end of  guest:x:1002:1002:,,,:/home/guest:/usr/sbin/jk_lsh but not following i.e. not an empty line with just the linefeed character after the guest line.

I removed the trailing linefeed after /jk_lsh, but I'm afraid it made no difference to the result, the connection still terminates as before. Thank you for your explanation of getpwnam(), I was puzzled by the "Success" reported there.

So any further thoughts about where I should look next would be welcome. Can I debug the call to getpwnam() somehow?

John

On Fri, Dec 14, 2018 at 1:03 PM Olivier Sessink <address@hidden> wrote:
On 14-12-18 13:10, John Pilkington wrote:
My apologies: having sent the first version of this request I realise it will be much easier for people to help me if I include the file contents that I refer to in-line:

I have set up an sftp/scp only shell for a jailed user (guest, pwd guest) under Raspbian Stretch and following very precisely the steps in the jailkit howto instructions for that scenario, except for the change in user name.

On sftp address@hidden the connection closes immediately after entering the password. Here are  the relevant lines in auth.log. 

Dec 14 09:47:29 raspberrypi sshd[7725]: Accepted password for guest from ::1 port 44498 ssh2
Dec 14 09:47:29 raspberrypi sshd[7725]: pam_unix(sshd:session): session opened for user guest by (uid=0)
Dec 14 09:47:29 raspberrypi systemd-logind[294]: New session c119 of user guest.
Dec 14 09:47:29 raspberrypi systemd: pam_unix(systemd-user:session): session opened for user guest by (uid=0)
Dec 14 09:47:29 raspberrypi jk_chrootsh[7742]: now entering jail /srv/sftpjail for user guest (1002) with arguments -c /usr/lib/openssh/sftp-server
Dec 14 09:47:29 raspberrypi jk_lsh[7742]: jk_lsh version 2.20, started
Dec 14 09:47:29 raspberrypi jk_lsh[7742]: cannot find user info for USER guest: Success

I just looked at the code, this means that the call to the system function getpwnam() was succesfull, but the system did not find user "guest" in the password file.. Which is weird because the passwd files look identical and correct.

is the line

guest:x:1002:1002:,,,:/home/guest:/usr/sbin/jk_lsh

in /srv/sftpjail/etc/passwd followed by a newline character? Possibly this could cause an issue?

Olivier

-- 
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
_______________________________________________
Jailkit-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/jailkit-users

reply via email to

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