Max remote sessions for login:admin is 2

http://community.brocade.com/t5/Fibre-Channel-SAN/Unable-to-login-maximum-number-of-remote-sessions-reached/td-p/11011


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.

 

这个错误表示您的系统没有权限打开名为 "sessions" 的 BPF (Berkeley Packet Filter) 映射。BPF 映射是一种在 Linux 内核中存储数据的机制,通常用于网络过滤器、监控和安全应用程序。 要解决这个问题,您需要确保您的系统具有打开 BPF 映射的权限。在 Linux 中,只有具有特殊权限的用户才能打开 BPF 映射。这些特殊权限通常称为 "BPF 系统权限"。 如果您是 root 用户,则默认具有 BPF 系统权限。如果您不是 root 用户,则需要将 BPF 系统权限授予给您的用户或分配给您的用户所属的组。 要将 BPF 系统权限授予给特定用户,请使用以下命令: ``` sudo setcap cap_sys_admin,cap_sys_ptrace,cap_bpf+ep /path/to/your/application ``` 其中,`/path/to/your/application` 是您的应用程序的路径。这个命令将授予您的应用程序三个特殊权限:`cap_sys_admin`、`cap_sys_ptrace` 和 `cap_bpf`。这些权限将允许您的应用程序打开 BPF 映射。 如果您无法授予 BPF 系统权限给特定用户,您可以创建一个新的组,并将该组分配给您的应用程序。然后,将该组授予 BPF 系统权限。这将允许属于该组的所有用户打开 BPF 映射。 要将 BPF 系统权限授予给特定组,请使用以下命令: ``` sudo setcap cap_sys_admin,cap_sys_ptrace,cap_bpf+ep /path/to/your/application sudo chgrp your_group /path/to/your/application sudo chmod g+s /path/to/your/application ``` 其中,`your_group` 是您创建的新组的名称。这个命令将授予您的应用程序三个特殊权限,然后将该组分配给您的应用程序。最后,它将设置组 ID 位,以确保所有属于该组的用户都具有打开 BPF 映射的权限。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值