LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Change username (https://www.linuxquestions.org/questions/ubuntu-63/change-username-596498/)

TerranML007 11-01-2007 09:18 PM

Change username
 
A friend of mine just recently installed Ubuntu 7.10 and wants to change his username; both of us are pretty new to Linux so we have pretty much no idea.

I glanced through the tutorials quickly (didn't have much time because we were in class) and didn't see anything, so I'm hoping someone can help us out.

Thanks!
-Craig

ranger_nemo 11-01-2007 09:38 PM

I don't think I would try changing a username... I would just add a new user and copy everything over to the new account.

$ sudo useradd new-name
$ sudo passwd new-name

Logout of the old account, and in with the new one.

$ sudo cp -R /home/old-name /home/new-name
$ sudo chown -R new-name.new-name /home/new-name

Those two commands will copy everything over from the old account to the new account, then set the ownership on all the files to the new account.

Hmmm... I don't know if the new account will automatically be added to the sudo list. You might have to edit /etc/sudoers to add the new account.

Once you've determined everything is working fine, you can delete the old account with userdel, and free up the hard-drive space by deleting the old account's home dir.

wit_273 11-01-2007 11:15 PM

Quote:

Hmmm... I don't know if the new account will automatically be added to the sudo list. You might have to edit /etc/sudoers to add the new account.
You could also edit /etc/group and add the new user to the admin group. This is the group that has sudo abilities of root in Ubuntu.


All times are GMT -5. The time now is 02:28 PM.