LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-06-2003, 04:45 PM   #1
totalcommand
LQ Newbie
 
Registered: Aug 2001
Posts: 23

Rep: Reputation: 15
Changing User IDs (UID)


Hello, I am trying to change user id's on my computer so that they match those of another computer (this will enable me to use nfs without conflicts between usernames - and i don't want to use nis). The problem is one user on one computer has the same user id as another user on the other computer I have edited the /etc/passwd file and the /etc/group file to change and match the user id's, then I ran a

chown -R <username> /home/<username>

and

chgrp -R <username> /home/<username> .

After this, all ownerships and groups seem to be correct, but KDE goes beserk and stops working (stuff on the desktop disappears, applications won't run...).

Next, I tried doing

find . -user <olduid> -exec chgrp <newgid> {} \;
find . -user <olduid> -exec chown <newuid> {} \;

I'm told that this should change anything with the old UID to the new UID. Kde still refuses to work. Then I heard something about editing the /etc/shadow file to reset the password - this did not work either. Any ideas?

Redhat 8.0

Thanks
 
Old 06-06-2003, 05:01 PM   #2
emetib
Member
 
Registered: Feb 2003
Posts: 482

Rep: Reputation: 33
chown and chgrp only change what the files are. what you have to do is to change your group/user id. so what you want to do is to -

usermod -u

that will be the command to use, this will change your /etc/group and /etc/passwd for you. take a look at the man pages for the options and the specific way that you should type it in.

cheers.
 
Old 06-06-2003, 05:37 PM   #3
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: fedora, slackware, suse
Posts: 448

Rep: Reputation: 31
Manually editing of the files /etc/passwd and /etc/group, and then changing ownership should work. I've done it plenty of times. A chown as you did it unfortunately may not get the hidden files. However, the find command, at least on my implemnetation does "find" them. Just for the sake of it you might check the .dotfiles in the /home directory. Might kde keep some database that gets confused, or maybe some socket in /tmp or such that it is trying to use? This is strictly a guess, but that is where I would look next.
 
Old 06-06-2003, 06:00 PM   #4
emetib
Member
 
Registered: Feb 2003
Posts: 482

Rep: Reputation: 33
if you would like to do it that way, then

chown --recursive user:user /home/user/*

cheers.
 
Old 06-06-2003, 06:28 PM   #5
Rick422
Member
 
Registered: Apr 2003
Location: Arizona
Distribution: Red Hat Linux 9
Posts: 158

Rep: Reputation: 30
I am using Red Hat 9 and you can create a new user and specify their user ID while creating that user name. If you have Gnome installed and running what follows should work when creating a new user. To do that click on the Red Hat Icon, then click on System Settings, then Click on User and Groups and give it the root user password if it asks for it, then click on Add User then click on Specify ID Manually then click on the UID number and change it. If I remember correctly, doing that under Red Hat 8.0 was the same.

I have several copies of Linux and always make sure that I have the same User ID number in each version of Linux. The reason that I do that is that I have one partiton that I use with each version of Linux. Having the same user ID is helpful because when I create a file and later open it with a different version of Linux the file still belongs to me! If I had a different user ID number in that version of Linux I would not be able to open the file.
 
Old 06-06-2003, 06:47 PM   #6
totalcommand
LQ Newbie
 
Registered: Aug 2001
Posts: 23

Original Poster
Rep: Reputation: 15
I think when I tried the find command I got some errors in the /proc/<random 4 numbers> when trying to change ownership and group. I cd'd into those directories and they seemed to be a mirror of almost the whole / directory. What is this?
 
  


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
changing UID of a user to "0" paeng16 Linux - Security 5 06-16-2004 11:31 PM
changing permissions and the UID... viper91681 Solaris / OpenSolaris 3 03-11-2004 09:47 AM
changing uid, gid zeke1955 Linux - General 4 01-09-2004 11:53 PM
Linux User IDs ? xwastedmindx Linux - General 2 11-12-2003 07:52 PM
remap? user ids? GATTACA Linux - Networking 3 10-15-2003 01:15 PM


All times are GMT -5. The time now is 10:04 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration