Shell/Bash: ubuntu rename user login Example

By

Shell/Bash Example: This is the "ubuntu rename user login" Example. compiled from many sources on the internet by SimpleTutorials.org

ubuntu rename user login

#As root / or as another user. 
# Kill the processes of the user to rename
pkill -u 

#Rename user login
usermod -l  

#Rename HomeDir 

sudo usermod -d /home/NewHomeDir -m NewLoginName

change username ubuntu

# -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]

change ubuntu username

# To manage every aspect of the user database, you use the usermod tool.
# To change username (it is probably best to do this without being logged in):

sudo usermod -l newUsername oldUsername
# This however, doesn't rename the home folder.
# To change home-folder, use

sudo usermod -d /home/newHomeDir -m newUsername



* Summary: This "ubuntu rename user login" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!

Others