Search This Blog

Wednesday, November 21, 2018

Debug for user with nologin / headless in linux

For users such as postfix, jenkins with nologin in linux, you can temporarily change it to, for example:
usermod -s /bin/bash postfix
for debugging.


You need to change back to /sbin/nologin though.

You can do the other way:

$ sudo chsh -s /bin/bash postfix
Changing shell for postfix.
Shell changed.
$ getent passwd postfix | cut -d: -f7
/bin/bash
sudo chsh -s /sbin/nologin postfix  (or /bin/false)
Changing shell for postfix.
See also:

How to check/change a user's default login shell