LinuxQuestions.org
Review your favorite Linux distribution.
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 02-06-2009, 01:49 PM   #1
openSauce
Member
 
Registered: Oct 2007
Distribution: Fedora, openSUSE
Posts: 252

Rep: Reputation: 39
Changing my numeric user id


Hi,

now that I'm pretty comfortable with Fedora, I've decided to start playing with Slackware a bit. I have an ext3 filesystem I'd like to share between the two distros, with both taking the owner of the files to be the one non-system user on each distro.

Unfortunately, Fedora user ids start at 500 by default, whereas Slack starts them at 1000. I think the easiest thing to do is to change the Fedora user's numeric id to 1000. Is this as simple as amending /etc/passwd and chowning /home on the Fedora install, or is there more to it than that? Do I need to do anything with /etc/shadow? Are there things going on in the background that expect my numeric id not to change?
 
Old 02-06-2009, 02:51 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
AFAIK, you can simply modify /etc/passwd as appropriate, and any new logins for the respective use will assume the new ID. You probably want to make the accordant change in /etc/group, as well. Any files that are owned by an abandoned UID can be chowned as necessary. Existing logins may misbehave if file permissions change in unexpected ways.
I have encountered the same issue, and fixed the problem as described.
--- rod.
 
Old 02-06-2009, 09:30 PM   #3
John VV
Guru
 
Registered: Aug 2005
Posts: 13,531

Rep: Reputation: 1807Reputation: 1807Reputation: 1807Reputation: 1807Reputation: 1807Reputation: 1807Reputation: 1807Reputation: 1807Reputation: 1807Reputation: 1807Reputation: 1807
make a new user in fedora and manually set the uid to 1000
system / admin/ users & groups
 
Old 02-07-2009, 06:08 AM   #4
GazL
Senior Member
 
Registered: May 2008
Posts: 3,503

Rep: Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027Reputation: 1027
By default slackware's users start at 1000, but there are no system userid's over 100, so you could quite happily just specify 500 as the uid when you create the user under slackware and then you don't have to change anything.
 
Old 02-07-2009, 06:31 AM   #5
openSauce
Member
 
Registered: Oct 2007
Distribution: Fedora, openSUSE
Posts: 252

Original Poster
Rep: Reputation: 39
Quote:
Originally Posted by theNbomr View Post
AFAIK, you can simply modify /etc/passwd as appropriate, and any new logins for the respective use will assume the new ID. You probably want to make the accordant change in /etc/group, as well. Any files that are owned by an abandoned UID can be chowned as necessary. Existing logins may misbehave if file permissions change in unexpected ways.
I have encountered the same issue, and fixed the problem as described.
--- rod.
Unfortunately this didn't go well. After updating /etc/passwd and /etc/group, and chowning my home dir, I was unable to log in.

As the services are getting initialised at boot time, I get the following error message repeatedly:

Quote:
Unknown username "root" in message bus configuration file
Could not get password database information for UID of current process: User "???" unknown or no memory to allocate password entry
Eventually the message stops repeating and ends with:
Quote:
Failed to start message bus: Could not get UID and GID for username "dbus" [FAILED]
Then most of the remaining services start successfully, apart from Avahi, which says [FAILED] but gives no error message.

Then after waiting several minutes with no messages, X fails to start and I'm presented with a text logon screen, but I can't login with either my normal username or root, it just gives the error message "Login incorrect".

I've now reverted /etc/passwd and /etc/shadow to their previous contents, but get exactly the same errors.


I checked there were no conflicts with another user/group having id 1000. The entries for the dbus user in the various files are
Quote:
/etc/passwd: dbus:x:81:81:System message bus:/:/sbin/nologin
/etc/shadow: dbus:!!:14005:0:99999:7:::
/etc/group: dbus:x:81:
I'm not sure if that's problematic - my understanding is that a disabled account has "*" in the password field, not "!!". Googling for the first line of my error message, I found one hit where somebody got the same message after updating /etc/passwd, but it relates to changing passwords, which I haven't done, and the suggestion to change a password using passwd seems unlikely to do anything in my situation.

Does anyone have any suggestions? I do have a recent backup of the system partition, but would prefer not to use it if possible as I've just downloaded > 1GB of package updates.
 
Old 02-07-2009, 06:33 AM   #6
openSauce
Member
 
Registered: Oct 2007
Distribution: Fedora, openSUSE
Posts: 252

Original Poster
Rep: Reputation: 39
Quote:
Originally Posted by GazL View Post
By default slackware's users start at 1000, but there are no system userid's over 100, so you could quite happily just specify 500 as the uid when you create the user under slackware and then you don't have to change anything.
Thanks, if I can get Fedora working again I'll probably do just that! Should have waited a couple more hours before having a go and I'd have seen this reply...
 
Old 02-11-2009, 07:07 PM   #7
openSauce
Member
 
Registered: Oct 2007
Distribution: Fedora, openSUSE
Posts: 252

Original Poster
Rep: Reputation: 39
Should have guessed, SELinux was up to its old tricks again. It turns out modifying /etc/{passwd,group} in single-user mode reset their security contexts, which could be returned to the correct values with restorecon.

For anyone else doing the same thing, there are also various Gnome config files scattered round the filesystem for which I was the owner. These can be chowned to the new uid with the commands
Code:
find / -user oldUID -exec chown newUID \{\} \;
find / -group oldGID -exec chown .newGID \{\} \;
 
  


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
changing user using su prasanta.choudhury Linux - Newbie 2 02-15-2006 08:38 PM
Changing User name akpadhi@hotmail.com LQ Suggestions & Feedback 7 01-13-2006 06:59 PM
Changing a User carlosinfl Linux - General 11 11-29-2005 03:25 PM
Changing user preference kool_kid Slackware 9 02-04-2005 10:19 AM
User id (needs changing) podollb Linux - Software 2 05-15-2004 10:26 AM


All times are GMT -5. The time now is 10:09 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration