Skip to content

[ssh limit] add infrastructure to set per user login limit #5338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

yxieca
Copy link
Contributor

@yxieca yxieca commented Sep 8, 2020

- Why I did it
We have an use case to limit max number of login per user.

- How I did it
Specifying per user login limit via USER_LOGIN_LIMIT build argument.

When not specified, the per user login is unlimited by default.

Signed-off-by: Ying Xie [email protected]

- How to verify it
Verified in 2 aspects:

  1. limit working on DUT: set the limit to 2 and validated that the 3rd login is rejected from ssh and/or console.
  2. build test: without specifying the limit, /etc/security/limits.conf didn't change. Build with option SSH_USER_LOGIN_LIMIT=2, and verified that the configuration changed accordingly.

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

Specifying per user login limit via USER_LOGIN_LIMIT build argument.

When not specified, the user login is unlimited by default.

Signed-off-by: Ying Xie <[email protected]>
@yxieca yxieca changed the title [ssh limit] add infrastructure to set ssh per user login limit [ssh limit] add infrastructure to set per user login limit Sep 8, 2020
@@ -161,3 +160,6 @@ SONIC_ENABLE_IMAGE_SIGNATURE ?= n

# ENABLE_SYNCHRONOUS_MODE - enable synchronous mode between orchagent and syncd
ENABLE_SYNCHRONOUS_MODE = n

# Default SSH per user login limit (unlimited)
DEFAULT_USER_LOGIN_LIMIT = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this tested and working? According to the man page, it appears that -1 is the numerical representation of unlimited:

All items support the values -1, unlimited or infinity indicating no limit, except for priority and nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants