用户工具

站点工具


linux:migrate

Migrate

Migrate Linux from X to Y.

Rename user

First of all, login with root , then using usermod to change username:

usermod -l newUserName -d /home/newUserName -m oldUserName
Linux use uid to identify user, so changing username will not affect permissions.

Then, find all broken symlinks and fix it:

find . -xtype l

Last but not least, Search all configurations and change username, I recommand ripgrep.

rg oldUserName

Reference

linux/migrate.txt · 最后更改: 2023/12/03 10:24 由 127.0.0.1