Maybe it is more related to sshd than to pam. If I do a ps -ef | grep ssh I frequently see lines like below. To my understanding starting a new ssh session is totally unnecessary.
# ps -ef | grep ssh root 406 1 0 Oct25 ? 00:00:21 /usr/sbin/sshd -D root 1301 406 0 08:02 ? 00:00:00 sshd: root@pts/0 # ps -ef | grep ssh root 406 1 0 Oct25 ? 00:00:21 /usr/sbin/sshd -D root 1301 406 0 08:02 ? 00:00:00 sshd: root@pts/0 root 14486 406 0 11:50 ? 00:00:00 sshd: [accepted] sshd 14487 14486 0 11:50 ? 00:00:00 sshd: [net] # ps -ef | grep ssh root 406 1 0 Oct25 ? 00:00:21 /usr/sbin/sshd -D root 1301 406 0 08:02 ? 00:00:00 sshd: root@pts/0 # ps -ef | grep ssh root 406 1 0 Oct25 ? 00:00:21 /usr/sbin/sshd -D root 1301 406 0 08:02 ? 00:00:00 sshd: root@pts/0 # ps -ef | grep ssh root 406 1 0 Oct25 ? 00:00:21 /usr/sbin/sshd -D root 1301 406 0 08:02 ? 00:00:00 sshd: root@pts/0 root 14520 406 0 11:50 ? 00:00:00 sshd: [accepted] sshd 14521 14520 0 11:50 ? 00:00:00 sshd: [net] -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to systemd in Ubuntu. https://bugs.launchpad.net/bugs/1727243 Title: pam_systemd Status in systemd package in Ubuntu: New Bug description: my auth.log is full of messages like below. The 79.247.. is my own address and there seems to be something which tries to reconnect every other second although I am already in a running session. What is going on here? Oct 25 10:38:57 h... sshd[6506]: Accepted publickey for root from 79.247... port 52067 ssh2: RSA SHA256:pru... Oct 25 10:38:57 h... sshd[6506]: pam_unix(sshd:session): session opened for user root by (uid=0) Oct 25 10:38:57 h... systemd-logind[285]: New session 2373897 of user root. Oct 25 10:38:57 h... sshd[6506]: pam_systemd(sshd:session): Cannot create session: Already running in a session Oct 25 10:38:57 h... sshd[6506]: Received disconnect from 79.247... port 52067:11: disconnected by user Oct 25 10:38:57 h... sshd[6506]: Disconnected from 79.247... port 52067 Oct 25 10:38:57 h... sshd[6506]: pam_unix(sshd:session): session closed for user root Oct 25 10:38:57 h... systemd-logind[285]: Removed session 2373897. Oct 25 10:38:59 h... sshd[6524]: Accepted publickey for root from 79.247... port 52068 ssh2: RSA SHA256:pru... Oct 25 10:38:59 h... sshd[6524]: pam_unix(sshd:session): session opened for user root by (uid=0) Oct 25 10:38:59 h... systemd-logind[285]: New session 2373898 of user root. Oct 25 10:38:59 h... sshd[6524]: pam_systemd(sshd:session): Cannot create session: Already running in a session Oct 25 10:38:59 h... sshd[6524]: Received disconnect from 79.247... port 52068:11: disconnected by user Oct 25 10:38:59 h... sshd[6524]: Disconnected from 79.247... port 52068 Oct 25 10:38:59 h... sshd[6524]: pam_unix(sshd:session): session closed for user root Oct 25 10:38:59 h... systemd-logind[285]: Removed session 2373898. Oct 25 10:39:01 h... CRON[6565]: pam_unix(cron:session): session opened for user root by (uid=0) Oct 25 10:39:01 h... CRON[6564]: pam_unix(cron:session): session opened for user root by (uid=0) Oct 25 10:39:01 h... sshd[6562]: Accepted publickey for root from 79.247... port 52069 ssh2: RSA SHA256:pru... Oct 25 10:39:01 h... sshd[6562]: pam_unix(sshd:session): session opened for user root by (uid=0) Oct 25 10:39:01 h... systemd-logind[285]: New session 2373904 of user root. Oct 25 10:39:01 h... sshd[6562]: pam_systemd(sshd:session): Cannot create session: Already running in a session Oct 25 10:39:01 h... sshd[6562]: Received disconnect from 79.247... port 52069:11: disconnected by user Oct 25 10:39:01 h... sshd[6562]: Disconnected from 79.247... port 52069 Oct 25 10:39:01 h... sshd[6562]: pam_unix(sshd:session): session closed for user root Oct 25 10:39:01 h... systemd-logind[285]: Removed session 2373904. Oct 25 10:39:01 h... CRON[6565]: pam_unix(cron:session): session closed for user root Oct 25 10:39:02 h... sshd[6665]: Accepted publickey for root from 79.247... port 52070 ssh2: RSA SHA256:pru... Oct 25 10:39:02 h... sshd[6665]: pam_unix(sshd:session): session opened for user root by (uid=0) Oct 25 10:39:02 h... systemd-logind[285]: New session 2373945 of user root. Oct 25 10:39:03 h... sshd[6665]: pam_systemd(sshd:session): Cannot create session: Already running in a session Oct 25 10:39:03 h... sshd[6665]: Received disconnect from 79.247... port 52070:11: disconnected by user Oct 25 10:39:03 h... sshd[6665]: Disconnected from 79.247... port 52070 Oct 25 10:39:03 h... sshd[6665]: pam_unix(sshd:session): session closed for user root Oct 25 10:39:03 h... systemd-logind[285]: Removed session 2373945. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1727243/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : [email protected] Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp

