此功能可防止并发会话数超过可配置的数量。默认值设置为 0,这意味着将绕过并发会话检查。如果已达到最大并发会话计数,则会阻止其他登录。除此之外,用户可以使用 shell --clear-sessions 登录,这会使所有活动会话失效。

管理员可通过 NSX Advanced Load Balancer CLI 或 REST API 控制此功能。其设置是在 UserAccountProfile 对象中维护的。默认情况下,系统中的所有用户都会连接到 Default-User-Account-Profile,如下所示。如果需要,管理员可以创建具有不同阈值的新用户帐户配置文件。

admin:10-10-24-52]: > show useraccountprofile Default-User-Account-Profile
+-------------------------------+---------------------------------------------------------+
| Field | Value |
+-------------------------------+---------------------------------------------------------+
| uuid | useraccountprofile-6753548e-7ac5-4601-939b-ad4394405db4 |
| name | Default-User-Account-Profile |
| max_password_history_count | 0 |
| max_login_failure_count | 20 |
| account_lock_timeout | 30 |
| max_concurrent_sessions | 0 |
| credentials_timeout_threshold | 0 |
+-------------------------------+---------------------------------------------------------+
To change the maximum number of concurrent sessions:
[admin:10-10-24-52]: > configure useraccountprofile Default-User-Account-Profile
Updating an existing object. Currently, the object is:
[admin:10-10-24-52]: useraccountprofile> max_concurrent_sessions 5
Overwriting the previously entered value for max_concurrent_sessions
[admin:10-10-24-52]: useraccountprofile> save
+-------------------------------+---------------------------------------------------------+
| Field | Value |
+-------------------------------+---------------------------------------------------------+
| uuid | useraccountprofile-6753548e-7ac5-4601-939b-ad4394405db4 |
| name | Default-User-Account-Profile |
| max_password_history_count | 0 |
| max_login_failure_count | 20 |
| account_lock_timeout | 30 |
| max_concurrent_sessions | 5 |
| credentials_timeout_threshold | 0 |
+-------------------------------+---------------------------------------------------------+

如果已达到阈值,用户可以选择使用 shell 命令的 --clear-sessions 选项使现有会话失效。

root@10-10-24-52:/home/admin# shell
Login: admin
Password:
小心:

已达到最大并发会话计数。请使用 shell –clear-sessions 清除会话

root@10-10-24-52:/home/admin/# shell –clear-sessions Login: admin Password: [admin:10-10-24-52]: >

在观察到以下任一情况时,这些会话将被视为无效:

  • 用户的 UI 会话结束,并显示登录屏幕。

  • 用户的 CLI 会话将结束,并且屏幕上未显示任何指示。键入的下一个命令将触发对新 CLI 会话的重新验证,并执行该命令。

  • REST API 用户的下一个 API 调用将无法验证。或者,如果 REST API 用户在会话中执行调用,则会话将结束。