This is a discussion on group and user ownerships are off after moving users from server A to server B within the Linux Administration forums, part of the Linux Forums category; By 'fixing' the group and passwd files (as well as group- and passwd-) the system seems to be sent more ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
By 'fixing' the group and passwd files (as well as group- and passwd-)
the system seems to be sent more out of whack. Take a look at the pertinent information below. Notice that everything works well for each user only that there are four users (gonzalo, roxana, sam and scott) that have questionable /etc/passwd listings and only two users (gonzalo, roxana) whose directory listing is actually off. /etc/group the original version gonzalo:x:500: scott:x:501: onur:x:502: sam:x:503: jason:x:504: dan:x:505: david:x:506: matt:x:507: josh:x:508: rob:x:509: roxana:x:510: jeremy:x:511: michael:x:512: /etc/passwd the orginal version dan:x:503:503::/home/dan:/bin/bash david:x:504:504::/home/david:/bin/bash jason:x:506:506::/home/jason:/bin/bash josh:x:507:507::/home/josh:/bin/bash matt:x:508:508::/home/matt:/bin/bash michael:x:509:509::/home/michael:/bin/bash onur:x:510:510::/home/onur:/bin/bash rob:x:511:511::/home/rob:/bin/bash sam:x:502:500:sameer:/home/sam:/bin/bash gonzalo:x:512:502:gzo:/home/gonzalo:/bin/bash roxana:x:513:512::/home/roxana:/bin/bash scott:x:514:513::/home/scott:/bin/bash jeremy:x:515:515::/home/jeremy:/bin/bash patrick:x:518:518::/home/patrick:/bin/bash ls -lah listing for a few users. Note that almost the entire listing per user has ownerships as the line that I've included here. [root@backupserver root]# ls -lah /home/gonzalo -rw------- 1 sam onur 513 Feb 3 10:45 .bash_history [root@backupserver root]# ls -lah /home/jason -rw------- 1 jason jason 24 Jan 21 13:17 .bash_history [root@backupserver root]# ls -lah /home/dan -rw-r--r-- 1 dan dan 191 Nov 13 17:24 .bash_profile [root@backupserver root]# ls -lah /home/sam -rw-r--r-- 1 sam sam 191 Feb 11 2003 .bash_profile [root@backupserver root]# ls -lah /home/roxana -rw-r--r-- 1 roxana patrick 191 Feb 11 2003 .bash_profile [root@backupserver root]# ls -lah /home/scott -rw-r--r-- 1 scott scott 191 Feb 11 2003 .bash_profile [root@backupserver root]# ls -lah /home/onur total 272M -rw-r--r-- 1 onur onur 191 Nov 13 17:26 .bash_profile ---------------------------------------------------------------------- At this point I made sure to edit/fix the group and passwd files and copied the 'fixed' group file into /etc/group and /etc/group-; the 'fixed' passwd file into /etc/passwd and /etc/passwd-. /etc/group 'fixed' gonzalo:x:512: scott:x:514: onur:x:510: sam:x:502: jason:x:506: dan:x:503: david:x:504: matt:x:508: josh:x:507: rob:x:511: roxana:x:513: jeremy:x:515: michael:x:509: patrick:x:518: /etc/passwd 'fixed' dan:x:503:503::/home/dan:/bin/bash david:x:504:504::/home/david:/bin/bash jason:x:506:506::/home/jason:/bin/bash josh:x:507:507::/home/josh:/bin/bash matt:x:508:508::/home/matt:/bin/bash michael:x:509:509::/home/michael:/bin/bash onur:x:510:510::/home/onur:/bin/bash rob:x:511:511::/home/rob:/bin/bash sam:x:502:502:sameer:/home/sam:/bin/bash gonzalo:x:512:512:gzo:/home/gonzalo:/bin/bash roxana:x:513:513::/home/roxana:/bin/bash scott:x:514:514::/home/scott:/bin/bash jeremy:x:515:515::/home/jeremy:/bin/bash patrick:x:518:518::/home/patrick:/bin/bash ls -lah listing for a few users. Note that almost the entire listing per user has ownerships as the line that I've included here. root@backupserver root]# ls -lah /home/gonzalo -rw------- 1 sam sam 513 Feb 3 10:45 .bash_history [root@backupserver root]# ls -lah /home/dan -rw-r--r-- 1 dan 505 191 Nov 13 17:24 .bash_profile [root@backupserver root]# ls -lah /home/jason -rw------- 1 jason david 24 Jan 21 13:17 .bash_history [root@backupserver root]# ls -lah /home/scott -rw-r--r-- 1 scott 501 24 Feb 11 2003 .bash_logout [root@backupserver root]# ls -lah /home/sam -rw-r--r-- 1 sam dan 191 Feb 11 2003 .bash_profile As you can see, by seemingly fixing the group and passwd files, my system seems to have an even more inconsistent user and group relationship for each user. Furthermore, why are users scott and sam originally OK (in terms of their directory listings) and gonzalo and roxana are not? I am using RedHat 9. What do you recommend for fixing this small but annoying problem (change the ownerships using the 'users and groups' app from 'System Settings')? Any information would be very appreciated. |
|
|||
|
gonzo <gonzalohbriceno@yahoo.com> wrote:
> By 'fixing' the group and passwd files (as well as group- and passwd-) > the system seems to be sent more out of whack. Take a look at the > pertinent information below. Notice that everything works well for > each user only that there are four users (gonzalo, roxana, sam and > scott) that have questionable /etc/passwd listings and only two users > (gonzalo, roxana) whose directory listing is actually off. After making all the UIDs and GIDs unique, changing some in the process, you need to use chmod -R on their home directories to transfer ownership back to them. -- Cameron Kerr cameron.kerr@paradise.net.nz : http://nzgeeks.org/cameron/ Empowered by Perl! |
|
|||
|
Cameron Kerr <cameron.kerr@paradise.net.nz> wrote in message news:<40204ad5@news.maxnet.co.nz>...
> gonzo <gonzalohbriceno@yahoo.com> wrote: > > By 'fixing' the group and passwd files (as well as group- and passwd-) > > the system seems to be sent more out of whack. Take a look at the > > pertinent information below. Notice that everything works well for > > each user only that there are four users (gonzalo, roxana, sam and > > scott) that have questionable /etc/passwd listings and only two users > > (gonzalo, roxana) whose directory listing is actually off. > > After making all the UIDs and GIDs unique, changing some in the process, > you need to use chmod -R on their home directories to transfer ownership > back to them. I have used the chown command to fix this but not in unison with fixing the group and passwd files. Thank you for your advise. Other than fixing the group and passwd files and manually setting the correct permissions, are there any other fixes. From what I've read, at the core of the user and group permissions scheme are the passwd, shadow, group and gshadow files. Am I missing anything else? Lastly (out of curiosity), does it ever matter when a file's permission lists a uid as opposed to the account name this uid refers to? I understand that when making a backup of another machine, for the files belonging to the remote machine, you will get permissions that list a uid and/or gid because that particular account does not exist in the current system. What does it mean if this occurs in the current system? Is it worth noting? Thanks again. |
|
|||
|
"gonzo" <gonzalohbriceno@yahoo.com> wrote in message
news:3aa13fd7.0402040908.c1eb5b6@posting.google.co m... > Cameron Kerr <cameron.kerr@paradise.net.nz> wrote in message news:<40204ad5@news.maxnet.co.nz>... > > gonzo <gonzalohbriceno@yahoo.com> wrote: > > > By 'fixing' the group and passwd files (as well as group- and passwd-) > > > the system seems to be sent more out of whack. Take a look at the > > > pertinent information below. Notice that everything works well for > > > each user only that there are four users (gonzalo, roxana, sam and > > > scott) that have questionable /etc/passwd listings and only two users > > > (gonzalo, roxana) whose directory listing is actually off. > > > > After making all the UIDs and GIDs unique, changing some in the process, > > you need to use chmod -R on their home directories to transfer ownership > > back to them. > > I have used the chown command to fix this but not in unison with > fixing the group and passwd files. Thank you for your advise. > Other than fixing the group and passwd files and manually setting the > correct permissions, are there any other fixes. From what I've read, > at the core of the user and group permissions scheme are the passwd, > shadow, group and gshadow files. Am I missing anything else? > Lastly (out of curiosity), does it ever matter when a file's > permission lists a uid as opposed to the account name this uid refers > to? I understand that when making a backup of another machine, for > the files belonging to the remote machine, you will get permissions > that list a uid and/or gid because that particular account does not > exist in the current system. What does it mean if this occurs in the > current system? Is it worth noting? Thanks again. I have the feeling you may have somewhat missed the point. The passwd file & its freinds are not at the core of the scheme at all. The filesystem only holds uid & gid as a number. As you say, when you list a file which shows a uid as opposed to a username its because the uid isnt in the passwd file. So really you would have to fix the passwd file(s) then do chown with the usernames after. Of course you could do chown with the final uid then change the passwd files after, but that would surely just be self abuse ?. -- Jonathan. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|