LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-09-2005, 03:29 PM   #1
Pear-i
LQ Newbie
 
Registered: Oct 2004
Distribution: U! U! U! Ubuntu!
Posts: 12

Rep: Reputation: 0
is there a way to rename a user?


hey there -- just wondering if there's a way to rename a user -- that is change the user name.

>i was thinking of making a completely new account but i've already setup the settings for the first account so just need away to use a different username and still retain all the settings

thanks

Last edited by Pear-i; 09-09-2005 at 03:31 PM.
 
Old 09-09-2005, 03:40 PM   #2
puffinman
Member
 
Registered: Jan 2005
Location: Atlanta, GA
Distribution: Gentoo, Slackware
Posts: 217

Rep: Reputation: 30
Try the -l (that's dash ell) option with the usermod command. See man usermod.
 
Old 09-09-2005, 03:57 PM   #3
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 47
Failing that, changing the user's name in /etc/password, /etc/shadow and /etc/group & renaming the /home directory would probably work. . .
 
Old 09-09-2005, 04:16 PM   #4
imitheos
Member
 
Registered: May 2005
Location: Greece
Posts: 433

Rep: Reputation: 115Reputation: 115
Quote:
Originally posted by oneandoneis2
Failing that, changing the user's name in /etc/password, /etc/shadow and /etc/group & renaming the /home directory would probably work. . .
Yes, that would work. It's the manual way of doing it.
But, there are some other things you must do also. (e.g /var/mail/login_name etc)

that is why usermod exists :P

Let's suppose the username is foo (/home/foo) and we want to make it bar (/home/bar)

usermod -d /home/bar -m -l bar foo

-d takes the new home directory
-m moves the stuff from the old home to the new
-l takes the new login_name

for more info run "man usermod"

Depending on the distribution you use, there will also be from 1 to 100 gui programs that do user management.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rename session_id with appended user name jilljack Programming 2 10-12-2005 12:30 PM
How to rename user account? SuSE messed it up... GeeZuZz Linux - Newbie 2 07-17-2004 07:23 PM
plz....rename him alaios Linux - General 1 12-06-2003 09:41 AM
Rename my pc ? Tanc Linux - Newbie 6 09-13-2003 08:28 AM
Rename host rhstudent Linux - Networking 1 04-04-2002 09:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:55 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