On Sun 05 Jun 2016 at 08:30:38 (-0400), Felix Miata wrote: > Mark Fletcher composed on 2016-06-05 11:40 (UTC): > > >I think both these options have one potential pitfall, which is file > >ownership after the copy over of stuff I want to salvage from the outgoing > >HDD. If I do a fresh install, no guarantee that user IDs will be the same > >on the new system as I of course don't remember now what order I installed > >stuff in. My regular user ID created during install will no doubt get the > >same ID (although even that is not guaranteed as this machine started life > >as etch, if I remember rightly, then was upgraded to squeeze, then to > >wheezy, and finally to Jessie). And I don't remember exactly when I > >installed, for example, mysql in relation to other stuff. So I could have > >some fun and games copying stuff over from the old disk to the new from > >that perspective. Any clever ploys to deal with that? > > Before you start, print /etc/passwd and /etc/group. :-) > > When forced to create a user during installation, I create user x > with passwd x, and the first thing I do on first boot is login as > root and delete user x. I then install mc and do my "tidy up" before > creating the group(s) I want and then use a script to create users, > followed by setting users' initial passwds.
I think users and their passwords are the least of the problem. A fresh install of jessie sets up about 30 system users before the admin ($UID=1000) gets a look-in. So you can end up with your email system being owned by statd.messagebus instead of Debian-exim.Debian-exim for example. You can diagnose the extent of the problem with a command like: # find / -mount -not -group 0 -exec ls -ld {} \; -o -not -user 0 -exec ls -ld {} \; | less but fixing it is probably a matter of for ... chown ... Cheers, David.