ssh connection closed automatically after login

Techmetix

New member
Joined
Aug 14, 2021
Messages
4
Hi after user login to ssh to putty below error coming and shh is automatically closed immediately after login.

Dec 26 15:50:34 rsl202 sshd[2688]: pam_unix(sshd:session): session opened for user elision by (uid=0)
Dec 26 15:50:36 rsl202 sshd[2688]: lastlog_openseek: Couldn't stat /var/log/lastlog: No such file or directory
Dec 26 15:50:36 rsl202 sshd[2688]: lastlog_openseek: Couldn't stat /var/log/lastlog: No such file or directory
Dec 26 15:50:37 rsl202 sshd[2688]: pam_unix(sshd:session): session closed for user elision


where is error and how to clear please guide me.

I am already did following steps but same error comming.

touch /var/log/lastlog
chown root:root /var/log/lastlog
cmod 644 /var/log/lastlog

but no solution.
 
So that is the very last you did?
Can you again then post the output of:
ls -la /var/log/lastlog

Also, which Linux distro and version are you on?
 
So that is the very last you did?
Can you again then post the output of:
ls -la /var/log/lastlog

Also, which Linux distro and version are you on?
[root@rsl202 ~]# ls -la /var/log/lastlog
-rw-r--r-- 1 root root 300760 Dec 28 19:26 /var/log/lastlog

And putty versions also

Other users ssh is ok?

only root ssh is ok and all other ssh same problem, after successfully login immediately closed.

putty version - 0.76

NAME="CloudLinux"
VERSION="7.9 (Boris Yegorov)"
ID="cloudlinux"
ID_LIKE="rhel fedora centos"
VERSION_ID="7.9"
PRETTY_NAME="CloudLinux 7.9 (Boris Yegorov)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:cloudlinux:cloudlinux:7.9:GA:server"
HOME_URL="https://www.cloudlinux.com/"
BUG_REPORT_URL="https://www.cloudlinux.com/support"
 
Normally there is a dot behind that, like this:
-rw-r--r--.


Do these accountnames exist in the /etc/sshd/sshd_config file?


how can add dot ?

there is information regarding these user names in config file but in directadmin I provided ssh access.
 
how can add dot ?
I don't know. Maybe if you delete the file that it will be created automatically and then it has the dot, but I'm not sure. The dot means that it has a SELinux security context. But if you don't use SELinux then it probably doesn't matter if it has no dot behind it.

As for the accounts, I don't understand why root is working fine and accounts a thrown out after a few seconds. Maybe it has something to do with Cloudlinux, I have no clue, sorry.
 
I don't know. Maybe if you delete the file that it will be created automatically and then it has the dot, but I'm not sure. The dot means that it has a SELinux security context. But if you don't use SELinux then it probably doesn't matter if it has no dot behind it.

As for the accounts, I don't understand why root is working fine and accounts a thrown out after a few seconds. Maybe it has something to do with Cloudlinux, I have no clue, sorry.
no worry, and thanks.
 
Back
Top