Changing the login shell for a user

From wiki
Revision as of 16:37, 31 January 2015 by imported>Johayek
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Changing the login shell for a user

If you experience an error like:

su: cannot run /sbin/nologin: No such file or directory

when you try to do

su some_user

you have to change the login shell for that user.

Notice: You should be sure about using vi properly before doing this.

This is done with the following line:

vi /etc/passwd

You'll see a line like this:

some_user:x:1025:100:Descriptive text:/nonexist:/sbin/nologin

Change that line to:

some_user:x:1025:100:Descriptive text:/nonexist:/bin/ash

Save the file, and you're done. You're now able to do

su some_user