LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-02-2009, 10:38 AM   #1
abhijeetdutta
Member
 
Registered: Aug 2009
Posts: 141

Rep: Reputation: 16
Rename home directory


Hi

In rhel i have a username 123 and i have renamed to 456 by usermod -l, but still its showing user name 123 home directory and their profile, so my question is that how to change all credentials 123 to 456 user.
 
Old 11-02-2009, 11:08 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Take a look at the man page for usermod........The -l option changes only the login name. If nothing else, you need to change the directory name in /home.
 
Old 11-02-2009, 11:12 AM   #3
cantab
Member
 
Registered: Oct 2009
Location: England
Distribution: Kubuntu, Ubuntu, Debian, Proxmox.
Posts: 553

Rep: Reputation: 115Reputation: 115
In /etc/passwd, you'll have a line that's something like

Code:
username:x:1000:100:Real Name,,,:/home/username:/bin/bash
Just change the username in both places to the new value. Then rename the home directory. That should work.
 
Old 11-02-2009, 12:04 PM   #4
abhijeetdutta
Member
 
Registered: Aug 2009
Posts: 141

Original Poster
Rep: Reputation: 16
Thanks!!

Now this is something what in my /etc/passwd

456:x:501:301:SAP System Administrator:/home/123:/bin/csh

Now i am bit confused in which of the places i have to do the change.
 
Old 11-02-2009, 12:38 PM   #5
cantab
Member
 
Registered: Oct 2009
Location: England
Distribution: Kubuntu, Ubuntu, Debian, Proxmox.
Posts: 553

Rep: Reputation: 115Reputation: 115
change it to

Code:
456:x:501:301:SAP System Administrator:/home/456:/bin/csh
Then you need to do

mv /home/123 /home/456

to rename their home directory
 
  


Reply



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
[SOLVED] rename an existing user and his home directory cccc Debian 5 10-29-2009 11:05 AM
"Home directory already exists. Please enter another home directory path." Daravon Ubuntu 2 02-15-2009 10:26 PM
contents of 'home' directory found at sda5: mounted as /home, and also on sda6:/home leswatson Linux - Newbie 4 04-18-2008 04:02 PM
rename a directory Volcano Linux - Newbie 5 02-22-2008 07:03 AM
rename all files in my directory BabaKali Linux - Newbie 2 11-10-2004 04:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:43 AM.

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
Open Source Consulting | Domain Registration