Re: Safe change of uid

2009-05-12 Thread Elmer E. Dow
I executed deluser --remove-all-files --backup  and it 
searched  for files to remove and backed up three files from the user's 
home directory -- but it left the user's home directory in place with 
its contents. The group and user were deleted, so the remaining files 
have owners of "500" -- the previous owner's original uid. The 
properties of those files still list the  owner's original uid which is 
500, so kuser failed to change the uid when I used kuser to do that. 
There is now  no user or group listed as having a uid of 500 -- at least 
according to kuser. Weird.


My apologies for the last post's line length. I was using my webmail 
account and forgot that I haven't found a way to change that.



--Elmer


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org




Re: Safe change of uid

2009-05-12 Thread Elmer Dow

I really did it this time. While looking over all my options carefully, I noted 
that in the documentation for kuser -- kde's user manager -- there's a line 
that says "delete users at your own risk"! That made me a little nervous about 
deleting a user with any method I chose. So I noticed that I could change the 
uid on the command line or in kuser, so I tried doing it in kuser.  No problem 
-- until I logged out. Then kdm flaked out. It wouldn't let me log in with the 
gui, so I dropped to a terminal and logged in, then did startx. I went to the 
kde login manager and had to tweak a few things there before getting it to 
allow users to shutdown the machine themselves, etc. My account appears to be 
working OK now, but when my daughter logs in she gets a blue screen with an 
error box at the top left corner saying: "Could not start kstartupconfig. Check 
your installation." Then when she clicks the OK button it throws her back to 
the login gui. She did Internet
 searches for her homework this evening logged on as me. Doug, I'm going to try 
your suggestion now and delete my daughter's account using  "deluser 
--remove-all-files --backup" after "cd /var/tmp." Then I'll recreate her 
account and hopefully get back closer to normal. I hope to report success. . . .

--Elmer


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Safe change of uid

2009-05-12 Thread Douglas A. Tutty
On Mon, May 11, 2009 at 05:27:14PM -0500, Elmer E. Dow wrote:
> Douglas A. Tutty wrote:
>> On Mon, May 11, 2009 at 08:54:47AM -0500, Elmer E. Dow wrote:
>>> Please cc me as I am not currently subscribing to the list.
>>
>> Since you only just created the user, I'd just go ahead and delete it
>> (use:
>> # cd /var/tmp
>> # deluser --remove-all-files --backup
>>
>> then use adduser to create the new user
>>
>> To be safe, I'd then examine the backup tarball to ensure that nothing
>> was removed accidentally, before deleting the tarball.

> From what I've read, it's like deluser in that it only deletes the user  
> stuff in the home directory, so I still need to edit /etc/passwd,  
> /etc/group, /etc/shadow, etc. and delete the user's group. Or is there a  
> command to take care of those, too? If there is, I haven't found it yet.  
> Or will adduser overwrite the previous info when I add the new user of  
> the same name?
>
> I've read of permission problems, boot problems, etc. caused by changing  
> uid so I'm a bit paranoid.

If you use deluser, you won't have to edit other files.  That's what
deluser is for.  

If you find any files in the backup that the user will need, you can
untar the tarball, chown them to the new user, and give them back.  I
tend to use Midnight Commander (mc) for that type of thing.

Doug.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Safe change of uid

2009-05-12 Thread Alex Samad
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


signature.asc
Description: Digital signature


Re: Safe change of uid

2009-05-12 Thread Andrei Popescu
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).

Regards,
Andrei
-- 
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)


signature.asc
Description: Digital signature


Re: Safe change of uid

2009-05-11 Thread Elmer E. Dow

Alex Samad wrote:

On Mon, May 11, 2009 at 05:29:04PM -0400, Douglas A. Tutty wrote:
  

On Mon, May 11, 2009 at 08:54:47AM -0500, Elmer E. Dow wrote:

Just finished a fresh Lenny install and added an account for my daughter  
-- and kuser assigned it uid 500 instead of 1001, which I must correct.  
After looking at man pages and archives, I see that kuser in the past  
has done well creating accounts but not modifying them. Is that still  
true with the version used in Lenny? Is usermod a better option for  
dealing with this situation or would deleting and recreating the account  
-- either using kuser or userdel -- be the simplest and best method?


Please cc me as I am not currently subscribing to the list.

  

Since you only just created the user, I'd just go ahead and delete it
(use:
# cd /var/tmp
# deluser --remove-all-files --backup

then use adduser to create the new user

To be safe, I'd then examine the backup tarball to ensure that nothing
was removed accidentally, before deleting the tarball.

I've never used (or heard of) kuser to know why it created uid 500.



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.



  

Doug.





  
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 "{}" \

Then I should do usermod -u 1001 
to change the user's uid.

Is order important here?

I'm tempted to try this instead of using deluser.


-Elmer




--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org




Re: Safe change of uid

2009-05-11 Thread Alex Samad
On Mon, May 11, 2009 at 05:29:04PM -0400, Douglas A. Tutty wrote:
> On Mon, May 11, 2009 at 08:54:47AM -0500, Elmer E. Dow wrote:
> > Just finished a fresh Lenny install and added an account for my daughter  
> > -- and kuser assigned it uid 500 instead of 1001, which I must correct.  
> > After looking at man pages and archives, I see that kuser in the past  
> > has done well creating accounts but not modifying them. Is that still  
> > true with the version used in Lenny? Is usermod a better option for  
> > dealing with this situation or would deleting and recreating the account  
> > -- either using kuser or userdel -- be the simplest and best method?
> >
> > Please cc me as I am not currently subscribing to the list.
> >
> 
> Since you only just created the user, I'd just go ahead and delete it
> (use:
> # cd /var/tmp
> # deluser --remove-all-files --backup
> 
> then use adduser to create the new user
> 
> To be safe, I'd then examine the backup tarball to ensure that nothing
> was removed accidentally, before deleting the tarball.
> 
> I've never used (or heard of) kuser to know why it created uid 500.

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.



> 
> Doug.
> 
> 

-- 
Emperor Palpatine:
Take your Jedi weapon! Use it. Strike me down with all
of your hatred and your journey towards the dark
side will be complete!


signature.asc
Description: Digital signature


Re: Safe change of uid

2009-05-11 Thread Roger Leigh
On Mon, May 11, 2009 at 05:27:14PM -0500, Elmer E. Dow wrote:
> Kuser is the KDE gui that's supposed to take the place of the command  
> line user management. It follows the Red Hat convention of users uid  
> starting at 500 instead of the Debian rule that starts them at 1000.  

If the program isn't following the Debian Policy for users and group
ID ranges, then it's buggy.  Please do file a bug report about it;
this one is a serious policy violation since the users are being
created in the system range.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Safe change of uid

2009-05-11 Thread Elmer E. Dow

Douglas A. Tutty wrote:

On Mon, May 11, 2009 at 08:54:47AM -0500, Elmer E. Dow wrote:
  
Just finished a fresh Lenny install and added an account for my daughter  
-- and kuser assigned it uid 500 instead of 1001, which I must correct.  
After looking at man pages and archives, I see that kuser in the past  
has done well creating accounts but not modifying them. Is that still  
true with the version used in Lenny? Is usermod a better option for  
dealing with this situation or would deleting and recreating the account  
-- either using kuser or userdel -- be the simplest and best method?


Please cc me as I am not currently subscribing to the list.




Since you only just created the user, I'd just go ahead and delete it
(use:
# cd /var/tmp
# deluser --remove-all-files --backup

then use adduser to create the new user

To be safe, I'd then examine the backup tarball to ensure that nothing
was removed accidentally, before deleting the tarball.

I've never used (or heard of) kuser to know why it created uid 500.

Doug.


  
Kuser is the KDE gui that's supposed to take the place of the command 
line user management. It follows the Red Hat convention of users uid 
starting at 500 instead of the Debian rule that starts them at 1000. 
From what I've read, it's like deluser in that it only deletes the user 
stuff in the home directory, so I still need to edit /etc/passwd, 
/etc/group, /etc/shadow, etc. and delete the user's group. Or is there a 
command to take care of those, too? If there is, I haven't found it yet. 
Or will adduser overwrite the previous info when I add the new user of 
the same name?


I've read of permission problems, boot problems, etc. caused by changing 
uid so I'm a bit paranoid.


Thanks for reminding me to --backup.


Elmer


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org




Re: Safe change of uid

2009-05-11 Thread Douglas A. Tutty
On Mon, May 11, 2009 at 08:54:47AM -0500, Elmer E. Dow wrote:
> Just finished a fresh Lenny install and added an account for my daughter  
> -- and kuser assigned it uid 500 instead of 1001, which I must correct.  
> After looking at man pages and archives, I see that kuser in the past  
> has done well creating accounts but not modifying them. Is that still  
> true with the version used in Lenny? Is usermod a better option for  
> dealing with this situation or would deleting and recreating the account  
> -- either using kuser or userdel -- be the simplest and best method?
>
> Please cc me as I am not currently subscribing to the list.
>

Since you only just created the user, I'd just go ahead and delete it
(use:
# cd /var/tmp
# deluser --remove-all-files --backup

then use adduser to create the new user

To be safe, I'd then examine the backup tarball to ensure that nothing
was removed accidentally, before deleting the tarball.

I've never used (or heard of) kuser to know why it created uid 500.

Doug.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Safe change of uid

2009-05-11 Thread Elmer E. Dow
Just finished a fresh Lenny install and added an account for my daughter 
-- and kuser assigned it uid 500 instead of 1001, which I must correct. 
After looking at man pages and archives, I see that kuser in the past 
has done well creating accounts but not modifying them. Is that still 
true with the version used in Lenny? Is usermod a better option for 
dealing with this situation or would deleting and recreating the account 
-- either using kuser or userdel -- be the simplest and best method?


Please cc me as I am not currently subscribing to the list.

Elmer E. Dow


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org