-   Linux - General (
-   -   How do I rename users? (RH 9) (

djs101 09-02-2003 05:32 PM

How do I rename users? (RH 9)

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! :)

fancypiper 09-02-2003 05:51 PM

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
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:
Configure X server:
Configure network:
Manage software:
Red Hat 9.0 Package Management Tool

djs101 09-02-2003 08:07 PM


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.

fancypiper 09-02-2003 08:21 PM

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

djs101 09-02-2003 09:04 PM

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.)

fancypiper 09-02-2003 09:17 PM

Post the result of this:

cd /home
ls -al

djs101 09-02-2003 09:51 PM

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.

djs101 09-02-2003 10:07 PM

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 :D

fsbooks 09-02-2003 10:10 PM

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/ but usually these become self-evident through use without breaking the system down.

fancypiper 09-02-2003 10:10 PM

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.

djs101 09-03-2003 05:37 PM

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)

All times are GMT -5. The time now is 05:24 PM.