You are not logged in.

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

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

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: 611

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

#3 2020-02-23 13:10:24

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

Re: SSH "Last login" message printed twice

paulkerry wrote:

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?

Sorry for the late reply. after a while when I try to login with other ssh clients I discovered that the issue only appears in native ssh client of windows 10. may be there is some thing wrong with the client, not server.


Novice.

Offline

#4 2020-02-23 20:32:14

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

Re: SSH "Last login" message printed twice

Glad you figured it out: maybe there is an option to change this on the windows side? Remember to prepend "[SOLVED]" to your first post.

Offline

Board footer

Powered by FluxBB