Is it feasible to relabel a Unix customer account?

I mounted Ubuntu on a computer system that is currently made use of by someone else. I relabelled the account with her name, yet it just transforms the fullname, not the customer name, which is still presented in the leading right (in the fast-user-switch-applet). Exists a command to relabel an Unix customer account?

I've considered developing a new customer account with the new name, and afterwards replicating every little thing in the "old" residence to the residence of the new account. Would certainly it suffice? Yet after that I assume the documents would certainly have the old account's approvals' proprietor? So should I do chown -R newuser ~?

Exists a simpler/recommended means to do this?

2019-05-05 23:48:20
Source Share
Answers: 2

While it is feasible to relabel a customer, and also usermod, this is fairly most likely to create problem. Below is a checklist of areas where the customer name might show up ; I do not assert that this checklist is extensive.

  • The customer access in /etc/passwd and also relevant documents (as an example /etc/shadow, /etc/master.passwd).
  • Team access in /etc/group (and also /etc/gshadow).
  • Perhaps access in /etc/sudoers.
  • The system mail box, commonly /var/mail/$USER or /var/spool/mail/$USER.
  • The crontab, commonly /var/spool/cron/crontabs/$USER
  • In at work (/var/spool/cron/atjobs/*)

The residence directory site is most likely to show up in a lot more areas. Several applications write outright courses in numerous dot documents. If you determine to relabel the residence directory site too (while there is no need that customer alice is residence directory site be /home/alice, having it be /home/bob would certainly be complex), you'll require to care for those. An international substitute will certainly benefit the majority of applications, yet I make no assurances. When possible, maintain the old residence directory site name as a symbolic link to the relabelled directory site.

2019-12-03 02:53:15


usermod --move-home --login <new-login-name> --home <new-home-dir> <old-login-name>

The --move-home alternative relocates the old residence directory site's materials to the new one offered by the --home alternative which is developed if it does not currently exist.

If you desire the key customer team to match the new-login-name, add --gid <new-login-name> to the command over, yet the team has to be pre - existing.

See the male web page for even more details :

man usermod
2019-05-08 09:35:47