Skip to content
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

T5145: Add maximum number of all logins on system #1939

Merged
merged 1 commit into from Apr 4, 2023

Conversation

sever-sever
Copy link
Member

@sever-sever sever-sever commented Apr 4, 2023

Change Summary

maxsyslogins
    maximum number of all logins on system; user is not
    allowed to log-in if total number of all user logins is
    greater than specified number (this limit does not apply
    to user with uid=0)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

login

Proposed changes

How to test

set system login max-login-session '1'
set system login timeout '600'

Try to connect via ssh from a new terminal.
Expected There were too many logins for 'vyos'.

$ ssh vyos@192.168.122.14
Warning: Permanently added '192.168.122.14' (ECDSA) to the list of known hosts.
Welcome to VyOS!

Check out project news at https://blog.vyos.io
and feel free to report bugs at https://vyos.dev

You can change this banner using "set system login banner post-login" command.

VyOS is a free software distribution that includes multiple components,
you can check individual component licenses under /usr/share/doc/*/copyright
There were too many logins for 'vyos'.
Last login: Tue Apr  4 17:08:10 2023 from 192.168.122.1
Connection to 192.168.122.14 closed.

Smoketest:

vyos@r14:~$ /usr/libexec/vyos/tests/smoke/cli/test_system_login.py
/usr/libexec/vyos/tests/smoke/cli/test_system_login.py:23: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.version import LooseVersion
test_add_linux_system_user (__main__.TestSystemLogin.test_add_linux_system_user) ... ok
test_radius_kernel_features (__main__.TestSystemLogin.test_radius_kernel_features) ... ok
test_system_login_max_login_session (__main__.TestSystemLogin.test_system_login_max_login_session) ... ok
test_system_login_otp (__main__.TestSystemLogin.test_system_login_otp) ... ok
test_system_login_radius_ipv4 (__main__.TestSystemLogin.test_system_login_radius_ipv4) ... ok
test_system_login_radius_ipv6 (__main__.TestSystemLogin.test_system_login_radius_ipv6) ... ok
test_system_login_user (__main__.TestSystemLogin.test_system_login_user) ... ok
test_system_user_ssh_key (__main__.TestSystemLogin.test_system_user_ssh_key) ... ok

----------------------------------------------------------------------
Ran 8 tests in 28.998s

OK
vyos@r14:~$

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro and c-po and removed request for a team April 4, 2023 14:16
maxsyslogins
    maximum number of all logins on system; user is not
    allowed to log-in if total number of all user logins is
    greater than specified number (this limit does not apply
    to user with uid=0)

set system login max-login-session 2
@c-po c-po merged commit e520e08 into vyos:current Apr 4, 2023
4 of 6 checks passed
@sever-sever sever-sever deleted the T5145 branch May 10, 2023 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants