1 hours ago
This is very newbie question but I dont fully grasp unix users yet.
If I cat /etc/passwd there are different users:
systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin
sddm:x:127:134:Simple Desktop Display Manager:/var/lib/sddm:/bin/false
most of them are no login users (so we would say you can't log in unless it is a /bash user), but if I try this command:
su - mongodb
it prompts me for a password. Problem is I don't know the password in this case.
18 hours ago
If you are the super user (id=0) or commonly known as root, you cannot login in to it if shell is set to /usr/sbin/nologin or /usr/bin/false
as per the manpage description of nologin:
nologin displays a message that an account is not available and
exits non-zero. It is intended as a replacement shell field to
deny login access to an account.
If the file /etc/nologin.txt exists, nologin displays its
contents to the user instead of the default message.
The exit status returned by nologin is always 1.
but (always if you are root or can sudo commands) you can execute a bash as per one user which is noloign user, to impersonate him for troubleshooting
sudo -u mongodb /bin/bash
su -s /bin/bash mongodb
Those above command does not execute a login, but just execute a bash with the user permission, in this case as mongodb user.
NOTE: normally thos user are passwordless, that mean even the su - process ask you for a password that will never match with nothing also empty password.