On 12/05/2013 10:36 AM, jdd wrote:
Le 05/12/2013 15:31, David C. Rankin a écrit :
Simply copy or (rsync -av) the files from old to new computer. NOTE the file
notice that copying files from an old user to a newe user/machine may not work if the user UID is not the same. I use to move the passwd file entirely to keep them, but have only a handfull users :-)
jdd
Correct you are. I have gotten so used to using setup scripts with fixed UID/GID pairs (e.g. groupadd -g <####>; useradd -u <#####> -g <groupname>), that the UID mismatch completely slipped my mind. I haven't tested the impact of a mismatch on ssh connections, but a good consideration to check if things don't work. I gave up moving passwd files a few years ago when there was a change in (? pam or shadow?) or one of the supporting packages that changed the information in passwd or shadow. Since then I just have a bash script with all users/UID and groups/GID that I use to regenerate users and groups. Mindnummingly bland: #!/bin/bash [[ $UID -eq 0 ]] || { echo -e "\n ERROR: You must be root to run this script, \$UID: $UID can't...\n" exit 1 } ## normal groups to add to system groupadd -g 1000 skyline groupadd -g 1030 sharp <snip> ## users to add to groups gpasswd -a david skyline gpasswd -a david sharp <snip> useradd -u 1030 -g sharp -c "Sharp AR-M355N FTP" -M sharp echo -e "\n Setting password for user sharp FTP:" pwexit=1 while [[ $pwexit != 0 ]]; do passwd sharp pwexit=$? done unset pwexit <snip> A little slower to write the script the first time, but every install thereafter, user/group setup is a breeze --and-- I no chance of getting bitten by updates in passwd,pam,shadow,etc.... -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org