You are not logged in.

#1 2020-01-10 09:49:40

ifdog
Member
From: Great China
Registered: 2018-01-05
Posts: 12

SSH "Last login" message printed twice

Hi, I am facing a problem when I login my pc via SSH.
after a successful login, It shows like this:

ssh user@arch.mydomain.com 
user@arch.mydomain.com 's password:
Last login: Fri Jan 10 17:32:40 2020 from 223.235.126.228
Last login: Fri Jan 10 17:32:40 2020 from 223.235.126.228

It seems that the Last Login section printed twice.
After checking it over Internet, Im sure my sshd_config file have already contains following declaration:

UsePAM yes
PrintMotd no # pam does that

And my /etc/pam.d/system-login is like followings:

#%PAM-1.0

auth       required   pam_tally2.so        onerr=succeed file=/var/log/tallylog
auth       required   pam_shells.so
auth       requisite  pam_nologin.so
auth       include    system-auth

account    required   pam_tally2.so
account    required   pam_access.so
account    required   pam_nologin.so
account    include    system-auth

password   include    system-auth

session    optional   pam_loginuid.so
session    optional   pam_keyinit.so       force revoke
session    include    system-auth
session    optional   pam_motd.so          motd=/etc/motd
session    optional   pam_mail.so          dir=/var/spool/mail standard quiet
-session   optional   pam_systemd.so
session    required   pam_env.so

How do I make the message only appear once? thank you!


Novice.

Offline

#2 2020-01-17 21:31:45

paulkerry
Member
From: Sheffield, UK
Registered: 2014-10-02
Posts: 407

Re: SSH "Last login" message printed twice

Did you check the other files in /etc/pam.d for "motd" or if they been modified from default?
What about your user login shell files? Does this happen for all other users and have you tried a new user?

Offline

Board footer

Powered by FluxBB