Dotan Cohen
2010-Aug-09 05:47 UTC
[CentOS] Moving users from Debian-based distro to CentOS
I have a Debian machine with four users that I plan on migrating to CentOS. As per Debian habits the UIDs start with 1000. Is it enough to reuse the Debian /etc/shadow and /etc/passwd files over? Or will I need to configure some other things? I had considered just creating four new users starting from UID 500 then chown -R -ing the user's home directories, but I find that invasive and possibly error prone (maybe there are files that are not owned by them). All advice appreciated. Thanks. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com
John R Pierce
2010-Aug-09 05:59 UTC
[CentOS] Moving users from Debian-based distro to CentOS
On 08/08/10 10:47 PM, Dotan Cohen wrote:> I have a Debian machine with four users that I plan on migrating to > CentOS. As per Debian habits the UIDs start with 1000. > > Is it enough to reuse the Debian /etc/shadow and /etc/passwd files > over? Or will I need to configure some other things? I had considered > just creating four new users starting from UID 500 then chown -R -ing > the user's home directories, but I find that invasive and possibly > error prone (maybe there are files that are not owned by them). > > All advice appreciated. Thanks. >I'd compare the passwd files, noting the predefined system accounts. when I copy over /etc/passwd entries, I generally cut/paste them, not just copy the whole file. of course, the same entries for /etc/shadow
John R Pierce
2010-Aug-09 18:06 UTC
[CentOS] Moving users from Debian-based distro to CentOS
On 08/08/10 10:47 PM, Dotan Cohen wrote:> I have a Debian machine with four users that I plan on migrating to > CentOS. As per Debian habits the UIDs start with 1000. > > Is it enough to reuse the Debian /etc/shadow and /etc/passwd files > over? Or will I need to configure some other things? I had considered > just creating four new users starting from UID 500 then chown -R -ing > the user's home directories, but I find that invasive and possibly > error prone (maybe there are files that are not owned by them). > > All advice appreciated. Thanks. >why not use useradd with the -u uid option so they match? don't forget groups, btw. -g, -G, and create the groups with the same GID's.
On Mon, Aug 9, 2010 at 1:47 AM, Dotan Cohen <dotancohen at gmail.com> wrote:> I have a Debian machine with four users that I plan on migrating to > CentOS. As per Debian habits the UIDs start with 1000. > > Is it enough to reuse the Debian /etc/shadow and /etc/passwd files > over? Or will I need to configure some other things? I had considered > just creating four new users starting from UID 500 then chown -R -ing > the user's home directories, but I find that invasive and possibly > error prone (maybe there are files that are not owned by them). > > All advice appreciated. Thanks.I prefer to start my users at 1000, even on RH/CentOS systems. Check out the libuser.conf file which has configuration for the minimum user ID (LU_UIDNUMBER). I set to mine to 1000.
On Mon, Aug 9, 2010 at 1:47 AM, Dotan Cohen <dotancohen at gmail.com> wrote:> I have a Debian machine with four users that I plan on migrating to > CentOS. As per Debian habits the UIDs start with 1000. > > Is it enough to reuse the Debian /etc/shadow and /etc/passwd files > over? Or will I need to configure some other things? I had considered > just creating four new users starting from UID 500 then chown -R -ing > the user's home directories, but I find that invasive and possibly > error prone (maybe there are files that are not owned by them). >Durn.... pushed send before I finished thinking.. You'd want to use a find by uid with the exec option.. find . -uid 12345 -exec chown johndoe {} \; Keep in mind that if you have NFS mounts you'll need to synchronize the uids on both systems.