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

Re: Safe change of uid



On Tue, May 12, 2009 at 10:12:59AM +0300, Andrei Popescu wrote:
> On Mon,11.May.09, 22:27:57, Elmer E. Dow wrote:
> 
> >> I usually (rightly or wrongly) vim /etc/passwd, then find / -uid 500 -exec
> >> chmod 1000 "{}" \; and maybe the same if I have to change the gid.
>    
> > Let me see if I understand this correctly. Here's what it appears to me  
> > that I should do.
> >
> > First I"ll use vipw to edit  /etc/passwd  and vipw -s to edit the   
> > shadowfile to change the uid.
> > Then edit with vigr and vigr -s  /etc/group and the shadow file  to  
> > change the gid.
> >
> > Now to change files out in the system:
> >
> > find / -uid 500  -exec chmod 1000 "{}" \
> >
> > Find files with a uid of 500 and execute the command chmod to  change  
> > the uid to 1001 (I'm 1000, so my daughter  will be 1001).
> >
> > And finally to change the files with a gid of 500 to 1001:
> >
> > find / -gid 500  -exec chmod 1001 "{}" \
> 
> Sorry, but the 'chmod' is definitely wrong. You probably want 'chown' 
> (and do read the manpage first).
yes he is right I wrote that first thing in the morning.
plus you probably don;t need the usermod as you have changed passwd +
groups + shadow by hand !


> 
> Regards,
> Andrei



-- 
"I don't think you give timelines to dictators."

	- George W. Bush
08/27/2004
in the New York Times

Attachment: signature.asc
Description: Digital signature


Reply to: