PDA

View Full Version : Need to change UID number



dpeirce
28th October 2007, 05:25 AM
I need a way of changing the UID number in Fedora 7 from 500 to 1000, and of fixing the results of changing it already in kuser. I've used Linux for a while now but am essentially a newbie. Background:

I've always wanted to dual boot several distros of Linux giving them common access to my data files located on a separate partition. However, even though I always use the same user name, one distro is often unable to read/write the files laid in by another distro. Recently I noticed that some distros have different UID *numbers*; Kubuntu 7.10 uses 1000 for the first user, while Fedora 7 uses 500. So, using kuser, I changed the UID number in Fedora to 1000. Fedora then refuses to boot; I gather it's confused by the change and can't read necessary files from /home/user.

Also, I can't get a command prompt in Fedora. And chown seems to deal only with changing the name, not the number.

Using info garnered from various posts in the Fedora forum, from Kubuntu I've edited Fedora's /etc/passwd and group files to reflect 1000 rather than 500. There are a number of "500" files in Fedora's /tmp, but I'm unable to change the numbers from the properties dialog in Kubuntu. Rebooting isn't successful.

Again, can I repair the damage without re-installing? And is there a simple way of changing the user ID number in one distro to match that of another? Or even, is that what I need to do in the first place to share files between distros?

In faith, Dave
Viva Texas

hermouche
28th October 2007, 05:51 AM
Hy,

In Gnome:
When you create a user name, well you can specify user/group ID manually.
#system-config-users

So what you can do, save your documents somewhere.
Delete the actual user name.
Create a new user name and here you have the possibility to choose any number greater than 500.

In KDE, i suppose it's the same.

Hope it helps

red

dpeirce
28th October 2007, 06:09 AM
Thanks, Hermouche. So, in Fedora as root (?) using kuser I would delete user dave, then create another user dave with my chosen UID#, and reboot?

dpeirce
28th October 2007, 06:14 AM
I wonder too if, on install , create user dave1, reboot and then create user dave with chosen UID#?

Can't work... too simple ^_^.

In faith, Dave
Viva Texas

hermouche
28th October 2007, 06:36 AM
I wonder too if, on install , create user dave1, reboot and then create user dave with chosen UID#?

Can't work... too simple ^_^.

In faith, Dave
Viva Texas

Yes just do it. I think it's a good idea to create dave1, choose the right UID (ie:1000) and then just logout/login with new user dave1.

red

EDIT:
What do you mean by on install. You don't have to install anything, just create another user name with your favorite UID.

dpeirce
2nd November 2007, 12:42 AM
Sorry for the delay in responding; Church, a short trip, and many honeydos.

But I have a winner here!!! I tried using a root console to set a new user and UID#, but couldn't penetrate Fedora 7's adduser and passwd commands. Seems they really really don't want to let me set my own UID#.

So:

I installed Fedora 7 afresh, using new user dave2. Everything went well and dave2's desktop came up (UID was 500). Fedora's System > Administration > Users and Groups allows to manually set the UID for a NEW user. In 'Create New User', I established user dave with UID# 1000; rebooted as dave/1000, used 'User Manager' again to delete dave2 (mark the one to delete, go to File > Delete); rebooted as dave/1000 and edited some of the common files which had been unavailable to me as dave/500. It appears there is no more permission problem between files created in Kubuntu and edited in Fedora!! Now to see if it works installing Mandriva 2008 ^_^.

How simple, and I've been trying to figure this out for a couple of years. I just hope I don't stumble into a hidden boobytrap somewhen.

In faith, Dave
Viva Texas

dpeirce
2nd November 2007, 12:53 AM
And, Red, I couldn't do that because I needed the user name to match as well as the UID#... and the user name I needed already had the wrong UID#. I learned at the beginning of this thread you can't simply change an existing UID# because it makes it impossible to boot.

Sharing common files between different distros apparently only works if the user name and UID# are both identical.

In faith, Dave
Viva Texas

Seve
2nd November 2007, 01:41 AM
Hello Dave:
I moved your other post to Guides & How-To-Articles
http://forums.fedoraforum.org/showthread.php?t=170631

Seve

gstool
2nd November 2007, 03:26 AM
I confronted this situation many years ago. I have always used Red Hat/Fedora as my main system and will continue to do so, but like to try other distros to see what they have.

When installing a Linux distro other than RH/Fedora/clone that sets the UID to something other than 500, I just do the initial setup using a user name other than my own, for example firstuser. After booting as firstuser, I then add my real username as a new user with UID=GID=500, and then get rid of firstuser. I make sure the main group name for my username has the same name as my username also.

To maintain my documents shared in all systems, I have a partition called /lnxdata on which all documents are saved. This partition is mounted in all the systems I have installed, and since the username, UID and GID are the same in each Linux instance, the data is seamlessly shared. Using this partition rather than storing data in multiple /home/username directories or trying to share a /home/username directory between distros allows each distro to optimize the user settings separate from all the other distros. It also makes selection of what to back up extremely easy.

An additional technique is to share application setup data such as all bookmarks, Mail directories etc., by having the "real" copy located in /lnxdata/gerry, with soft links from all the normal locations for these things in the various distros to this partiition. For example, I have a /lnxdata/gerry/firefox directory with the bookmarks, and a /lnxdata/gerry/thunderbird directory with the Mail directory and the abook,mab address book data, and the same for several other programs I use in all distros.

I hope this is helpful to someone.

Gerry

dpeirce
2nd November 2007, 04:00 AM
gstool, Hi. Wish I had run across you two years ago !^_^! But that's about what I'm doing. I put my data in a separate partition and then mount it during an install as /mnt/common. It contains my text files, mail, tomboy, bookmarks, gnotes, calendar, pictures, html files, etc. Then I put links in /home/dave of each distro to the appropriate file in common. The only files I keep on a specific distro are files particular to that one distro.

It works well.

In faith, Dave
Viva Texas

gstool
2nd November 2007, 04:08 AM
HI Dave,

By not running into me earlier, you probably learned more generating the solution for yourself.

Gerry

dpeirce
2nd November 2007, 04:10 AM
Yes, but it hurt!!!

Dave

dpeirce
2nd November 2007, 04:11 AM
Seve, thanks.

Dave

gstool
2nd November 2007, 04:24 AM
Dave,

After our interchange above, I found your other post that Seve moved. Amazing how similar our solutions are.

Gerry

dpeirce
2nd November 2007, 04:32 AM
And so simple. I spent two years, every time I changed from one distro to another I had to manually change everything to root; then I'd work and new stuff would go in as dave; then I'd change again and have to make it all root again. Once I forgot to change my mail folder; then in the next distro I fired up kmail and watched as all my old emails disappeared.

This will be so much easier and safer.

Dave

Jongi
26th September 2008, 09:52 PM
i probably should have done a search for this thread before i went about chaning the uid on my user on my F9 install. I can login. It seems that most things still work. But I have a feeling that other problems are going to surface.