Can I use /sbin/nologin to prevent a user to have access to interactive shell?
Can I use /sbin/nologin to prevent a user to have access to interactive shell?
Thanks in advance |
According to man nologin, that's the entire purpose of the program. To prevent logins, that is.
|
You can create /etc/nologin to restrict users from login into the system. Only root login will be allowed then.
--- Adding ------- Hi @jeffersonmvg, Perhaps I didn't read your question properly & I thought you want to restrict users from login into system. Anyway, you can use /sbin/nologin shell to restrict user, but check whether this is available in your system or not. If it's not available, then you can add /bin/false as shell for the user whom you do not wish to give login access. Code:
usermod -s /sbin/nologin username Code:
username:x:123:123:Sample:/dev/null:/bin/false |
Thank you shivaa :D
|
All times are GMT -5. The time now is 09:52 AM. |