📅  最后修改于: 2022-03-11 14:49:58.298000             🧑  作者: Mango
# -l changes login name
# -d changes home directory
# -m copies over contents from old home directory
usermod -l -d /home/ -m
# NOTE: will not work if you are currently logged on as user
# - workaround by temporarily enabling root account and running above command there
# [sudo passwd root]
# - after root account has been used to change username lock it using
# [sudo passwd -l root]