Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
on other system you have to do su - and enter the root password when prompted to get root privileges. Also - as shown in my example - you can change the home directory as well, since it is not done automatically. The -d option specifies the new home dir and the -m option is meant to move the content of the old home directory to the new one. See man usermod for future reference.
sudo -s
vipw
mv /home/olduser /home/newuser
# the chown below is only necessary of UID or GID change
chown -R newuser:newgroup /home/newuser
The commands like usermod and useradd, etc. are good for scripts.
Add "sudo" in front of the usermod command if you are not root, or become root with either sudo or su, and then run the command.
You also need to move the users home directory (so add -the -m option to usermod) and you need to change all the file and directory permissions from the old user to the new user.
[ edit: again only need to change UID/GID on files if UID/GID if you change UID/GID in passwd file. ]
The commands like usermod and useradd, etc. are good for scripts.
Add "sudo" in front of the usermod command if you are not root, or become root with either sudo or su, and then run the command.
You also need to move the users home directory (so add -the -m option to usermod) and you need to change all the file and directory permissions from the old user to the new user.
If you don't want to use usermod, why not just edit /etc/passwd, changing your username field and the home page field. This would retain the UID which might be in tar backups, or external drives. If you keep your old UID, you don't need to run chown on your home directory.
I tried changing the username. But now there is another problem.
When I try to log in,a dialog says:
"User's $HOME/.dmrc file is being ignored. This prevents the default session and language from being saved. Fild should be owned by the user and have 644 permissions. User's $HOME directory must be owned by user and not writable by other users.
and when I hit the OK button, it says:
"Your session only lasted less than 10 seconds. If you have not logged out yourself, this could mean that there is some installation problem or that you may be out of disk space. Try logging in with some of the filesafe sessions to see if you can fix this problem."
I logged in in filesale GNOME but the dialogs appear as such again.
What shall I do?
Should I reinstall ubuntu or what? And if to reinstall it too, how?
and can u explain about 644 permissions too?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.