LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-31-2007, 04:25 PM   #16
fc6_user
Member
 
Registered: Jan 2007
Location: Montpellier, France
Distribution: Fedora Core 6, Mandriva, Knoppix, Debian
Posts: 143

Original Poster
Rep: Reputation: 15
UID & GID changed, but I can no longer access my home directory!!


Having two OSs on the same machine, I wanted to share files on a common ext3 partition. I was told to change the UID & GID so that they are the same in order to have rwx permissions from any OS and to simplify things in general. I did so. I have Mandriva and Debian. The Mandriva user was 500 and the Debian user was 1000. I changed the Mandriva user to 1000 (across the board, i.e., ...

[... I just realized that I can't even open up a terminal! ...]

i.e. ... So that uid=1000(linux) gid=1000(linux) groups)1000(linux))

What happened!? How can I correct this problem? I saved all of my data, so it's not that big a deal. I could start all over and create new user accounts, deleting the ones that aren't working properly.

Help!!!

(Thanks!)
 
Old 05-31-2007, 05:09 PM   #17
fc6_user
Member
 
Registered: Jan 2007
Location: Montpellier, France
Distribution: Fedora Core 6, Mandriva, Knoppix, Debian
Posts: 143

Original Poster
Rep: Reputation: 15
Just a little more info...

I had to do it in three steps:

usermod -u 1000 username
groupmod -g 1000 groupname (or username, not sure, they were the same)
usermod -g 1000 username (or groupname?)

When omitting the second step (groupmod -g), I got an error message.

Also, once I had changed everything, Mandriva acted really weird. I couldn't access any of my directories or files, I couldn't even open a terminal! When I logged in and logged out, things were better, however, only when I restarted my computer did things go back to normal.

I then tried editing documents from both OSs (Mandriva and Debian) which were saved on the same shared ext3 partition. It worked like a charm.

Now, this is fine for my partition and my files. How about other users? There will be no separate data partition for other users, but it would be nice to be able to switch OSs and to rwx from any OS. If I simply give each user the same UID and GID, would that make this possible? How about desktop settings and so on? Or would it be better to give each user a separate UID for each OS but identical GIDs? I'll have a look on the Net of course, but I imagine that my setup is not at all typical and that I won't find a clear answer anywhere. Who would want to set up so many OSs on the same computer? I'm doing it as a sort of an experiment. It's not really an ideal setup. I eventually want to add yet a third linux OS.

Many thanks to all.
 
Old 05-31-2007, 07:41 PM   #18
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You may need to install a package to get the setfacl and getfacl utilities. I think it is the "acl" package. You can use your package manager to find out for sure.

Also, you can only use them on files and directories in a filesystem that supports acls. Ext3 and reiserfs do.

Read the manpages and the examples in /usr/share/doc/packages/acl/ to learn how to use the commands.

Suppose that you have a directory owned by "mike". Mike wants to let "sally" read files in it; joebob read and write files in it; and members of the mikefanclub group to read files in it. All other users should be denied access. Using setfacl, mike can create permissions for these particular users.

---

If you change your own UID, make sure that you log out as a regular user first. That could be a problem you are having.

---

Since you have this partition mounted in your home directory, you could simply use "chmod o+rwx ~/lindata". Now when you boot into the other distro, even though the filesystem is owned by someone else, you can read and write files in it.
If you do this, make sure that your home directory isn't world readable. Mandriva creates a default group by the same name as the user, so as long as the 'o' permissions are masked out as in "rwxrwx---" (770). This will prevent other users from access files on ~/lindata because they can't reach it. You may need to add "umask 000" to your .profile script so that new files will be readable when you boot up in the second distro. This will create new files with full permissions.

Last edited by jschiwal; 05-31-2007 at 07:42 PM.
 
Old 05-31-2007, 08:42 PM   #19
fc6_user
Member
 
Registered: Jan 2007
Location: Montpellier, France
Distribution: Fedora Core 6, Mandriva, Knoppix, Debian
Posts: 143

Original Poster
Rep: Reputation: 15
Please disregard post #16. After writing it, I couldn't find it, so I thought it didn't register. I then wrote post #17... As regards post #16, when I rebooted my computer everything was back to normal.

Thanks for the reply jschiwal. I did notice another problem. In Debian, when I mounted the lindata partition, a "DATA" icon appeared on the desktop (not my doing!). I thought to myself: 'cool', I can access the lindata directory from the desktop or my home directory (I mounted it onto a directory called lindata in my home directory). I then realized that all users had access to 'lindata' and its contents! Crap! How can I make it so that that default "DATA" icon doesn't appear when creating a new user, and, more importantly, what do I have to do to make it so that nobody has access to my lindata directory?

jschiwal, your post is a little over my head, I'll have to reread it a few times and do a little more research. I'm not a newbie, but I'm not a veteran yet either... I do like a challenge though, so thanks for the info, and I'll post back when I have something new to report...
 
Old 06-01-2007, 06:56 PM   #20
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Quote:
Originally Posted by fc6_user
Please disregard post #16. After writing it, I couldn't find it, so I thought it didn't register. I then wrote post #17... As regards post #16, when I rebooted my computer everything was back to normal.

In Debian, when I mounted the lindata partition, a "DATA" icon appeared on the desktop (not my doing!).
If the desktop displays devices, then I don't think you can stop it from showing up. You need to rely on the permissions of the filesystem to deny access. This wrinkle means that your UID and GID for FC6 can't have a corresponding regular user in Debian, but since Debian starts UIDs at 1000, that shouldn't be a problem and is already the case. ( This is a partition on an internel drive isn't it? )

The manpages for chmod and chown, and the coreutils info manual will be what you need to read to understand permissions. For the getfacl/setfacl programs, look for the README file that comes with installing the package.
Also look at the "id" command to print out the username, group names with their corresponding UID & GID values.
 
Old 11-19-2008, 01:04 PM   #21
Brons
LQ Newbie
 
Registered: Aug 2006
Posts: 3

Rep: Reputation: 0
Hello, I got a similar problem.

Running SuSE 10.0 on an ordinary PC.
Installed Fedora 8 on the second hard drive.
Same username on both distros.
Couldn't access the home directory on the second hard drive from SuSE.
Checked the UID with the command id and found out that they were not the same on the two systems.
Changed the user and group-id in Fedora to match the ones in SuSE.
Code:
usermod -u 1000 brons
usermod -g 100 brons

Here's the problem:
When I then boot in Fedora and try to log in, KDE doesn't work properly.
I get a lot of error messages and the desktop is all messed up.
"An error occurred while loading or saving configuration information for ..."
When I reset the values of the user and group-id, KDE works just fine again.
I suppose KDE is unable to read some kind of profile, but how do I fix this?

Is it a possible solution to remove the user on the Fedora system and create a new one with the same UID as on the SuSE-system? If so, how do I do that?

I would be grateful for any help, as I'm just an ordinary Linux-user and not familiar with this kind of stuff.
 
Old 11-19-2008, 03:16 PM   #22
Brons
LQ Newbie
 
Registered: Aug 2006
Posts: 3

Rep: Reputation: 0
How about this:
On the second hard drive (Fedora 8).
Deleting the user.
Code:
userdel -fr brons
Adding the same user again.
Code:
useradd -u 1000 -g 100 -d /home/brons -c Full_Name -s /bin/bash brons
Log on as brons.

Will it work?
 
Old 11-19-2008, 03:20 PM   #23
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
please don#t drag up dead threads - new question = new thread.
 
  


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
Ability and inability to read and write on shared partition... rendezvous123 Linux - General 5 05-05-2007 12:37 AM
/home partition shared by different distros Hungry ghost Linux - Software 12 04-02-2006 06:32 PM
Write permissions on a mounted fat32 partition Cain_vX Linux - Newbie 1 03-27-2006 02:54 PM
Shared partition and user write permission dashnaam Linux - General 3 07-10-2005 01:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:29 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