I ran into this problem while logging into a DCX switch today.
Sorry! Max remote sessions for login:admin is 2
The "killtelnet" command could not resolve the problem. Also a "kill" on the "telnetd" or in my case a "sshd" was not possible.
To resolve the problem, I had to login as root and truncate the /var/run/utmp file. (Note: do not delete this file)
I specifically issued the following: cat /dev/null >/var/run/utmp .
What seemed to be the cause is an abnormally terminated telnet or ssh session. It left remnants of a session that can be seen using the "who" command but was no longer visible in the output of "i" or "killtelnet" commands.
I am pasting the putty session log for clarification.
user33@sanmgmt-host42:$ ssh admin@DCX001-A
admin@DCX001-A's password:
--------------------------------------------------
Sorry! Max remote sessions for login:admin is 2
Connection to DCX001-A closed.
user33@sanmgmt-host42:$ ssh root@DCX001-A
root@DCX001-A's password:
--------------------------------------------------
Disclaimer for Root and Factory Accounts Usage!
DCX001-A:root> who
root pts/0 Nov 19 20:33
admin pts/2 Mar 9 21:04
DCX001-A:root> i |grep pts
4 S 0 5684 5665 0 75 0 - 734 - pts/0 00:00:00 sh
4 S 0 7096 5684 0 78 0 - 3440 - pts/0 00:00:00 i
0 S 0 7097 5684 0 75 0 - 436 - pts/0 00:00:00 grep
0 R 0 7100 7096 0 80 0 - 557 - pts/0 00:00:00 ps
DCX001-A:root> killtelnet
Collecting login information....
List of sessions (1 found)
__________________________________________________
Session No USER TTY IDLE LOGIN@ FROM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 root pts/0 0.00s 20:26 10.44.44.40
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter Session Number to terminate (q to quit) q
DCX001-A:root> cat /dev/null >/var/run/utmp
DCX001-A:root> who
DCX001-A:root> logout
Connection to DCX001-A closed.
user33@sanmgmt-host42:$ ssh root@DCX001-A
root@DCX001-A's password:
--------------------------------------------------
Disclaimer for Root and Factory Accounts Usage!
DCX001-A:root> who
root pts/0 Nov 19 21:39
DCX001-A:root> logout
Connection to DCX001-A closed.
user33@sanmgmt-host42:$ ssh admin@DCX001-A
admin@DCX001-A's password:
--------------------------------------------------
DCX001-A:admin> uptime
22:14:23 up 662 days, 22:26, 1 user, load average: 0.28, 0.10, 0.02
DCX001-A:admin> logout
Connection to DCX001-A closed.