How do i disable remote access for non-root users over ssh? i would like to do this on demand if possible.
|
Everyone is doing this the hard way.. he said deny for all non-root users.. so just edit
Add the following
Then restart ssh Anyone in the wheel or root group will be allowed to ssh in | |||
|
feedback
|
|
Several possibilities:
| |||||
feedback
|
|
Can use PAM as well:
Then modify /etc/pam.d/sshd to add the following line after the other accounts: This will also allow you to restrict by network if you decide to do so in the future. | |||
|
feedback
|
|
If you want it to be on-demand, the standard way is to use Creating this file (with an optional message inside) will deny non-admin logins and display the message instead; removing the file will allow logins back. It can be applied to ssh, local logins, and anything else that uses PAM; just make sure that
the PAM configuration for the service requires | |||
|
feedback
|