[Discuss] Dropping obsolete commands (Linux Pocket Guide)
Daniel Barrett
dbarrett at blazemonger.com
Wed Nov 18 13:10:56 EST 2015
On Tue, Nov 17, 2015 at 09:08:44PM -0500, Chuck Anderson wrote:
>> Other than chfn, how do people usually change their Full Name in
>> /etc/passwd?
On November 18, 2015, Dan Ritter wrote:
>usermod comes along with useradd and userdel. Being able to
>supply everything on the command line (including a password
>hash) is a great improvement over interactive commands.
Dan is correct that "usermod -c" does the trick, e.g.,
$ sudo usermod -c 'John Smith,,,' jsmith
but unfortunately this command requires write access to /etc/passwd,
so normal users can't change their own names. In contrast, chfn is
setuid root, so anybody can change his/her own name. Hmm. Maybe chfn
has to stay....
[Insert your own horror story about chfn's setuid root status here.]
--
Dan Barrett
dbarrett at blazemonger.com
More information about the Discuss
mailing list