I have changed my username from “user” to “newuser”, but when I checked, with :
ls -la
I got that some folder is used in my old name, like this.
drwxr-xr-x 3 root root 4096 Sep 16 01:35 ..
-rw------- 1 newuser user 2643 Sep 17 11:25 .bash_history
-rw-r--r-- 1 newuser user 220 Sep 16 01:06 .bash_logout
I want to change the “user” to “newuser”
Can I do it ?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi,
you can rename the “user” to “newuser” with
usermod -l user -m -d /home/newuser newuser
-m for move-home, -d for new home directory path
If you want to rename the group “user” to “newuser”, you need this command
groupmod -n newuser user
-n for new-name
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.