3

I need to change the "real name" of a user (not the username).
For example if I have:

testuser:x:1001:1001:Max Mustermann,,,:/home/testuser:/bin/bash

And I want it to be:

testuser:x:1001:1001:Max Müller,,,:/home/testuser:/bin/bash

Can I just edit it manually or will that negatively effect anything (for example ssmtp)? I know that the username can be changed safely using usermod, but I never had to change the "real" name before.

HBruijn
  • 72,524
  • 21
  • 127
  • 192

2 Answers2

3

Rather than editing the password file directly it is recommended to use vipw which will set the appropriate locks to prevent file corruption.

But to change the display name (and other GECOS info) both a user and root can also use the chfn command.

Other than that, go ahead!

HBruijn
  • 72,524
  • 21
  • 127
  • 192
2

You can change the "username" (actually GECOS/comment) field with the usermod -c command

jlliagre
  • 8,691
  • 16
  • 36