Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month, online, via Jitsi Meet.

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] Dropping obsolete commands (Linux Pocket Guide)



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




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org