This article is a mirror article of machine translation, please click here to jump to the original article.

View: 21102|Reply: 0

[linux] The difference between /bin/false and /sbin/nologin, which prohibits users from logging in

[Copy link]
Posted on 4/7/2021 1:20:27 PM | | |
1 Difference
/bin/false是最严格的禁止login选项,一切服务都不能用。
/sbin/nologin只是不允许login系统

Tips:
Check the /etc/passwd file to see the shell used by each user

2.1 nologin
When the user is configured to /sbin/nologin, if the user ssh is used to the Linux operating system, it will prompt
This account is currently not available.


2.2 false
When the user is configured to /bin/false, ssh is displayed as follows
root@vultr:~# useradd -s /bin/false -M -N user111
root@vultr:~# su user111
root@vultr:~# whoami
root

There will be no prompt, and the user will not be able to switch




Previous:(Security).NET/C# prevents cross-directory access to downloads
Next:SFTP Couldn't read packet: Connection reset by peer
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com