On Sun, 16 May 2021 14:42:39 -0000 (UTC), William Unruh wrote:
> On 2021-04-22, Lynn Nicks <
lynn....@linux.com> wrote:
>
> edit /etc/passwd and change your username there. Edit /etc/shadow and
> change your username there.
I do not care if the answer is A valid answer to the question and is
more work than using the proper command to make the change.
For any lurkers:
It is poor advice and is woefully incomplete _IF_ user expects the
change to look/work like it was done correctly in the first place.
It can also causes the user problems when using tools to search for files
in their account. Example "locate $USER" or "locate $LOGNAME" depending
on distribution.
It is much better to use the proper tools to make the desired changes
than editing indicated files.
Possible commands of interest when scripting or manually making changes:
useradd, groupadd, passwd, userdel, groupdel, groupmod, gpasswd,
usermod, vigr, vipw, chage, chfn
example usage.
usermod --login new-name old-name
usermod --move-home --home /newhome/username username
usermod --login login_name --home /accounts/NEW CURRENT
groupmod --new-name NEW_group old_group