2

currently my lastlog on ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-77-generic x86_64) is not showing all ssh-connects. This seems a bit wired to me.

My deploy-user connects via jenkins ssh:notty. This connections are looged in /var/log/auth.log

Jun  9 16:40:03 hostname sshd[31691]: Accepted publickey for deploy from 192.168.1.129 port 38718 ssh2: RSA SHA256
Jun  9 16:40:03 hostname sshd[31691]: pam_unix(sshd:session): session opened for user deploy by (uid=0)
Jun  9 16:40:03 hostname systemd-logind[2009]: New session 6764 of user deploy.
Jun  9 16:40:03 hostname systemd: pam_unix(systemd-user:session): session opened for user deploy by (uid=0)
Jun  9 16:40:04 hostname sshd[31691]: pam_unix(sshd:session): session closed for user deploy

But lastlog is not listing them:

username@hostname:~# sudo last
username     pts/0        192.168.1.25    Fri Jun  9 16:39   still logged in
username     pts/0        192.168.1.25    Fri Jun  9 16:39 - 16:39  (00:00)
username     pts/0        192.168.1.25    Fri Jun  9 16:37 - 16:38  (00:01)
username     pts/0        192.168.1.25    Fri Jun  9 16:25 - 16:28  (00:01)

and lastlog is telling me, that the user deploy never logged in:

deploy                                     **Never logged in**

So, what could lead to this issue?

1 Answer 1

0

It's correct.

If you call a command without tty, e.g.

[root@myhost ~]# ssh monsoin001@otherhost.example.com mycommand

then the wtmp/btmp file will NOT be updated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.