[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help: mixed up passwords/files



On Mon, 2004-10-18 at 10:00, Tim Wood wrote:
> I've wondered for some time about the strange ownership I see of some 
> files/directories. I think I've worked out the cause, but am not sure 
> what to do to fix it.
> To step back a few years. I started a LAN when my son and I came into 
> conflict over who would get to use  the phone line for the Net. The 
> obvious solution was a LAN.  I'd forgotten that, naturally, in that 
> system (call it Deb2.4) I put myself down as the first user and then my 
> son. After adding my wife and daughter I had:
> 
> tim.x.1000:1000
> justin.x.1001:1001
> jan.x.1002:1002
> riss.x.1003:1003
> 

> Eventually I was confident in the 2.6 kernel and started using 2.6.7 on 
> Deb2.4. I then, recently, came across SimplyMEPIS (a Debian based 
> distribution) and decided to give it a try on the Deb2.6 partition. I, 
> again, used the same /home partition as on Deb2.4. I only added myself, 
> wife and daughter, as my son is on the other side of the continent, 
> ending up with:
> 
> tim:x:1000:100
> jan:x:1001:0
> riss:x:1002:0
> 
> On my Deb2.4 system the only user who seems to own all his/her owns 
> files in the Home directory, is myself. My wife's shows a mix of 
> ownership between herself and justin, which I attribute to having made 
> justin 1001 on Deb2.4 but jan 1001 on Deb2.6.
> I'm not sure why they should be wrong on Deb2.4 but suspect it happened 
> when I moved /home to it's own partition.
> 

Exactly. Files created under "deb26" were created with uid/gid which
matched different users on "deb24"

To fix this, you should be able to just switch the uids/gids in the
password file such that your deb24 password file matches your deb26 pwd
file. It appears from your /etc/passwd snippets that mepis adds users to
different groups than debian. You may need to add each user to their
default groups in /etc/group, then create groups for each individual
user (as is done in debian proper), and change the gids in the password
files as well. Once this is complete, you can (as root):

for $usr in jan tim riss; do chown -R $usr.$usr /home/$usr ; done


-davidc



Reply to: