top of page

Unix / Linux

User accounts:

​

Users are stored in a text file at /etc/passwd

Normally you would add and modify users via terminal commands, but you can also do it by hand by modifying this file. Even if you are manually modifying this file, it is advised to use the vipw command instead of using a text editor. This will ensure it gets locked and only one person makes changes to it at a time. The format for this file is described in the passwd manual page, which you can view with the command:

​

man passwd

​

Default starting files and directories for a new user are stored in /etc/skel

This means if you change those files you are changing what files a new user will start with in their home directory.

​

Groups are stored in a text file at /etc/group

Normally you would modify groups using terminal commands, but you can also directly modify that file. Even if you are directly modifying the file it is not recommended to use a text editor. Instead you should use the vigr command.

​

Passwords

​

Typically passwords are stored in an encrypted format in the /etc/shadow file. That is the case when shadow passwords are used, which is usually the case. Can't find the file? That is probably because it is extra hidden. Even if you look for it or try to open it in such a way that you expect to see all files, it might not seem to be there. This is because it is only readable by root. Normally you would not edit this file with a text editor. But if you insist on looking at it in one, as I do, here is a command that should allow you to see it: sudo cat /etc/shadow

Here is some information about the format that might prove helpful if you are trying to resolve user issues. It is a colon delimited file. The first column is the username and the second is the password. If the password is left blank, you can login as that user without a password. If it is set to * that means the account is disabled. Otherwise you should see an encrypted password there.

​

Some additional Password and user settings are stored in a config file called /etc/login.defs That file determines the behavior of the passwd command. More information can be found using man passwd.

bottom of page