Skip to content

Close console session due to user inactivity#9890

Merged
prgeor merged 1 commit intosonic-net:masterfrom
prgeor:console
Feb 2, 2022
Merged

Close console session due to user inactivity#9890
prgeor merged 1 commit intosonic-net:masterfrom
prgeor:console

Conversation

@prgeor
Copy link
Contributor

@prgeor prgeor commented Jan 29, 2022

Signed-off-by: Prince George prgeor@microsoft.com

Why I did it

The default sudo password prompt timeout is NOT working. This is causing the console session to be held up even though the user in active for a long period of time. Due to this, TMOUT or auto-logout is not taking effect because user cannot login to bash, leaving the console unusable.

How I did it

Explicitly set the password prompt timeout in sudoers

How to verify it

Verified

  1. The sudo password prompt timeout after 5 mins of inactivity
  2. After user has logged in to bash via console, the session timeout if user has not pressed key for more than 15 mins (TMOUT)

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

  • 201811
  • 201911
  • 202006
  • 202012
  • [x ] 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Prince George <prgeor@microsoft.com>
@prgeor prgeor self-assigned this Jan 29, 2022
Defaults!PASSWD_CMDS !syslog

# Make sure sudo password prompt times out after 5 mins
Defaults passwd_timeout=5
Copy link
Collaborator

Choose a reason for hiding this comment

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

passwd_timeout

Is it a well known issue in upstream? Do you have a tracking link for this bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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


# Automatically log out console ttyS* sessions after 15 minutes of inactivity
tty | grep ttyS >/dev/null && TMOUT=900
tty | egrep -q '^/dev/ttyS[[:digit:]]+$' && TMOUT=900
Copy link
Collaborator

@qiluo-msft qiluo-msft Feb 1, 2022

Choose a reason for hiding this comment

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

egrep

Is it a bug fix or refactor? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactor

@prgeor prgeor merged commit ff14aeb into sonic-net:master Feb 2, 2022
qiluo-msft pushed a commit that referenced this pull request Feb 8, 2022
Signed-off-by: Prince George <prgeor@microsoft.com>
judyjoseph pushed a commit that referenced this pull request Feb 14, 2022
Signed-off-by: Prince George <prgeor@microsoft.com>
yxieca pushed a commit that referenced this pull request Oct 25, 2022
Signed-off-by: Prince George <prgeor@microsoft.com>
@prgeor
Copy link
Contributor Author

prgeor commented Jan 5, 2023

@rlhui please help merge this PR to 201911

abdosi pushed a commit that referenced this pull request Jan 30, 2023
Signed-off-by: Prince George <prgeor@microsoft.com>
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.

5 participants