LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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-02-2003, 05:32 PM   #1
djs101
LQ Newbie
 
Registered: Sep 2003
Location: Ohio, USA
Distribution: Red Hat 9
Posts: 6

Rep: Reputation: 0
Question How do I rename users? (RH 9)


Hello!

I'm glad I found this forum

How do I rename a user? (I'm running Red Hat 9)

I've searched online, and can't find a definite solution.

thanks!
 
Old 09-02-2003, 05:51 PM   #2
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
Post specifics of exactly what you aren't getting right.

Some starting points:
Did you happen to think about the Red Hat documentition in your search?

# Red Hat links
Installing from a Hard Drive
Red Hat Linux Manuals
Get your mp3 support here
Maximum RPM
rpmfind
Easier software management: apt4rpm - Red Carpet
Red Hat 8.0 Tips & Tricks

# Red Hat 7.3 down configuration commands
setup leads to several configuration tools

# Red Hat 7.3 up configuration commands
Configure soundcard:
redhat-config-soundcard
Configure X server:
redhat-config-xfree86
Configure network:
redhat-config-network
Manage software:
redhat-config-packages
Red Hat 9.0 Package Management Tool

Last edited by fancypiper; 09-02-2003 at 05:53 PM.
 
Old 09-02-2003, 08:07 PM   #3
djs101
LQ Newbie
 
Registered: Sep 2003
Location: Ohio, USA
Distribution: Red Hat 9
Posts: 6

Original Poster
Rep: Reputation: 0
Okay,

All I want to do is change the username and have his Home Directory changed to his new name, etc...

I can change the username using "Red Hat User Manager" and that works fine, but the problem is when I try to change the Home Directory.

If I change to a new Home Directory (not existing yet), the next time the user logs on he gets a message saying that the directory doesn't exist and asks if he wants to log in with the root directory as his home. This won't work.

So... I created an empty directory where I had previously specified, and this time he gets a message saying that Red Hat "could not open or create the file /home/USER/.gconf-test-locking-file".

Next, I tried to specify the Home Directory as his new name, and then rename his old directory. Now when he logs on, Red Hat tries to log him in, but then the process just stops and I am forced to do turn off the PC using the power button.



Does this make sense? I can clarify anything if you need me to.
 
Old 09-02-2003, 08:21 PM   #4
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
If you have the new user created and the /home/olduser is renamed to /home/newuser do this command:

chown -R newuser.newuser /home/newuser
 
Old 09-02-2003, 09:04 PM   #5
djs101
LQ Newbie
 
Registered: Sep 2003
Location: Ohio, USA
Distribution: Red Hat 9
Posts: 6

Original Poster
Rep: Reputation: 0
The kernel took that command okay, but it's still not working yet.

Here's specifically what is happening:

When I log in using this new account, on the bottom of the splash screen box, the "Metacity Window Manager" icon loads for a long time (about 2 min.), then a couple more load, then "The Panel" icon takes a while (about 2 min.), then the "Red Hat Network Monitor" takes about 3 min., and lastly the "Authentication Icon" takes about 3 min. to load. After that, all I have is a blue screen and I can move my mouse around, but even after 10 min., nothing ever appears. I have to push the power button on my PC in order to shut down.

(These icons usually take about 3-5 seconds to load.)
 
Old 09-02-2003, 09:17 PM   #6
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
Post the result of this:

cd /home
ls -al
 
Old 09-02-2003, 09:51 PM   #7
djs101
LQ Newbie
 
Registered: Sep 2003
Location: Ohio, USA
Distribution: Red Hat 9
Posts: 6

Original Poster
Rep: Reputation: 0
I powered down the system (hard shut down) and then logged in as root.

Here are the results of that command:

[root@localhost root]# cd /home
[root@localhost home]# ls -al
total 16
drwxr-xr-x 4 root root 4096 Sep 2 21:44 .
drwxr-xr-x 20 root root 4096 Sep 2 22:35 ..
drwx------ 22 merv merv 4096 Sep 2 21:49 merv
drwx------ 3 sally sally 4096 Aug 31 09:18 sally

The old username I had was merve. I want to rename him as merv. Ignore sally. She's just a dummy account.
 
Old 09-02-2003, 10:07 PM   #8
djs101
LQ Newbie
 
Registered: Sep 2003
Location: Ohio, USA
Distribution: Red Hat 9
Posts: 6

Original Poster
Rep: Reputation: 0
I'm going to bed now, but I will be back online tomorrow evening to keep going with this problem.

Thank you so much for all your help!!!!!!!!

It is GREATLY appreciated. I look forward to giving back to the community as I gain more Linux knowledge
 
Old 09-02-2003, 10:10 PM   #9
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 464

Rep: Reputation: 52
In order to change the username and have his Home Directory changed to his new name forget the GUI. The linux operating system is really fairly simple, so learn how your system works. For example to change merve to merv ...

#> mv /home/merve /home/merv

Then edit /etc/passwd, /ext/shadow, and /etc/group and change all instances of merve to merv. You might be able to do it as follows:

#> </etc/passwd >/tmp/passwd sed s/merve/merv/g
#> </etc/shadow >/tmp/shadow sed s/merve/merv/g
#> </etc/group >/tmp/group sed s/merve/merv/g
#> mv /tmp/passwd /etc/passwd
#> mv /tmp/shadow /etc/shadow
#> mv /tmp/group /etc/group
#> chmod 644 /etc/group /etc/passwd
#> chmod 400 /etc/shadow

A script of course is the easiest way to do it.

Those three files are the way the system keeps track of who is who. There may be a few other files to take care of if you have something beyond a simple system, such as /etc/sudoers, or /var/spool/mail/merve, perhaps even /etc/sendmail.cf but usually these become self-evident through use without breaking the system down.

Last edited by fsbooks; 09-02-2003 at 10:11 PM.
 
Old 09-02-2003, 10:10 PM   #10
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
Try this and see if it works.
rm /home/merv/.gconf-test-locking-file

Instead of using power off button, see if you can't back out with control-alt-backspace.
If that doesn't work, try control-alt-F3

That should take you to a console login screen. Log in as root and shutdown that way. or command killall X

Examine /var/log/XFree86.0.log and post what looks like it might apply here.

Last edited by fancypiper; 09-02-2003 at 10:14 PM.
 
Old 09-03-2003, 05:37 PM   #11
djs101
LQ Newbie
 
Registered: Sep 2003
Location: Ohio, USA
Distribution: Red Hat 9
Posts: 6

Original Poster
Rep: Reputation: 0
User merv still can't log on. I'm having the same problem (computer not completely logging in). Apparently this is an issue with my individual system...

How about this:

I undo all of these changes and restore the merve account. I then create a new account named merv and then somehow copy all of his data and settings over to his new account?

Is there a command to do this? (copying profiles)
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can not rename files. Maximus2000 Linux - General 0 04-22-2004 01:36 PM
Rename my pc ? Tanc Linux - Newbie 6 09-13-2003 08:28 AM
rename shell mikeshn Linux - General 5 09-21-2002 09:42 AM
how can I rename my computer ? tied2 Linux - General 6 09-04-2002 08:12 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 09:41 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