I was wondering if there was a way to change the default GECOS fields on a user. Now, I don’t mean change their name, number, shell, etc. What I mean is change the field-type/name itself.
Like, for example, since I never use the “Work-Phone” field, could I say, rename it to something else, like “Address” ?
Also, is it possible to add completely new field entries as well?
All I could really find through searching is how to change the fields that are already set.
Essentially the only software that cares about the GECOS field content (beyond the first comma which delimits the full name) for anything is
adduser,chfnand similar program for updating the pasword file. To a very good approximation, nobody uses these subfields, so you’re free to put whatever you like in them.The hard-coded prompt strings in
adduseror option letters inchfnprobably can’t be changed — they are conventional uses anyway, and there is nothing like a central definition of subfield names anywhere. But don’t let that stop you from storing “user’s favorite food” in the field ostensibly for work phone numbers if that floats your boat.Note, however, that if you want to store any real information about users for more than toy purposes,
/etc/passwdis most probably not the place to do it. Use a separate user-information database which is easier to make Unicode clean.