LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 08-23-2007, 04:42 AM   #1
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Rep: Reputation: 31
How to change the user's name?


Hi!

I use FC and would like to change the login's name of a user. How may I do this so that the user gets a new name and that he remains the owner of all his datas?

thanks.
 
Old 08-23-2007, 04:53 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 74
You can use the usermod command e.g.
Code:
#usermod -l newlogin oldlogin
You can then make the user the owner of the previous users data e.g.
Code:
#chown -R newlogin:somegroup /home/oldlogin
I personally would rename the old home directory to the same name as the users login name e.g.
Code:
#mv /home/oldlogin /home/newlogin
and then do
Code:
#chown -R newlogin:somegroup /home/newlogin
 
Old 08-23-2007, 07:04 AM   #3
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Original Poster
Rep: Reputation: 31
Thank you very much. I'll try it. I'm quite surprised though that
Code:
usermod
doesn't change the ownership automatically. In the present case one could just create a new user and then use
Code:
chown
. The amout of work stays the same... except that you dpn't have to delete the old user if you use
Code:
usermod
.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change a user's primary group? Akhran Linux - Newbie 4 03-19-2010 09:54 PM
vsftpd won't change to user's home 012h Linux - Networking 2 09-23-2006 07:41 AM
How can I change a user's uid and gid? homesp Debian 2 05-31-2005 03:39 PM
change a user's gid eastj1974 Linux - Newbie 3 12-09-2003 05:40 PM
Why do user's passwords change? J_Szucs *BSD 7 07-09-2002 04:46 PM


All times are GMT -5. The time now is 06:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration