I'm working on a Debian server as an inexperienced admin. I need to change the full name of a user (not the login name) provided during adduser USERNAME
. How can I do this? I didn't find such an option in usermod
(http://linuxcommand.org/man_pages/usermod8.html).
Asked
Active
Viewed 4.7k times
19

hielsnoppe
- 293
- 1
- 2
- 7
3 Answers
33
The GECOS field in /etc/password
can be modified with the chfn(1)
command.
chfn -f "Joe Blow" jblow

Ignacio Vazquez-Abrams
- 45,939
- 6
- 79
- 84
-
This also works on RHEL / CentOS. – Fer García Jan 07 '19 at 21:11
-
Still works on Debian 10 Buster, XFCE, FWIW – scrat.squirrel Feb 07 '21 at 17:16
14
You can do the following
adduser username -c "John Snow" -s /bin/bash
modify
usermod -c "Snow John" username
To verify users' full name finger username

Valentin Bajrami
- 4,045
- 1
- 18
- 26
4
You can edit /etc/passwd
directly the full name a field in this file.

squareborg
- 592
- 3
- 14
-
although, if you are doing that be sure to use `vipw` instead of simply editing the file the usual way – Knoxy May 08 '20 at 00:49