0

If you add a user using useradd you get asked to supply some other information about the user (Full name, room number, work phone etc).

Where exactly is this information being stored? How do you access this information? How do you edit this information?

3 Answers3

2

These are GECOS data, and are stored in /etc/passwd, in the fifth field as a set of comma-separated values:

$ getent passwd pulse
pulse:x:115:122:PulseAudio daemon,,,:/var/run/pulse:/bin/false

They can be modified using the chfn command (preferably), or the usermod command.

I don't know if there are utilities to get a particular field directly, but you can parse the output of getent passwd or finger.

muru
  • 197,895
  • 55
  • 485
  • 740
1

The extra information is stored in the /etc/passwd file. Check it out:

cat /etc/passwd

To edit this information use the chfn command.

janos
  • 4,888
1

Its all in the /etc/passwd file. There, you can see all the accounts that exist on your Linux system and, the different fields that describe different things. By default, the /etc/passwd file has several entries about the root account and user accounts that were created at time of installation.

You can view the info using the finger command, and modify it using the chfn command. Also you can use the User Accounts entry to modify that info as well.

enter image description here

Mitch
  • 107,631