FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 08-09-2010, 05:47 AM
Dotan Cohen
 
Default 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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 08-09-2010, 05:59 AM
John R Pierce
 
Default 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



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 08-09-2010, 05:38 PM
Gary Greene
 
Default Moving users from Debian-based distro to CentOS

On 8/8/10 10:59 PM, "John R Pierce" <pierce@hogranch.com> wrote:
> 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
>

That and be careful of different hash algorithms being used.... (Found out
the hard way when migrating users from an OpenSuSE box to CentOS....)

--
Gary L. Greene, Jr.
IT Operations
Minerva Networks, Inc.
Cell: (650) 704-6633
Phone: (408) 240-1239

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 08-09-2010, 06:02 PM
Keith Roberts
 
Default Moving users from Debian-based distro to CentOS

On Mon, 9 Aug 2010, Gary Greene wrote:

> To: CentOS list <centos@centos.org>
> From: Gary Greene <ggreene@minervanetworks.com>
> Subject: Re: [CentOS] Moving users from Debian-based distro to CentOS
>
> On 8/8/10 10:59 PM, "John R Pierce" <pierce@hogranch.com> wrote:
>> 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).

what about using the `find` command, and piggy-back
the chown command on that?

`pinfo find`

"This manual shows how to find files that meet criteria you
specify, and how to perform various actions on the files
that you find. The principal programs that you use to
perform these tasks are `find', `locate', and `xargs'.
Some of the examples in this manual use capabilities
specific to the GNU versions of those programs."

Kind Regards,

Keith
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 08-09-2010, 06:06 PM
John R Pierce
 
Default 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.


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 08-09-2010, 06:42 PM
Bill Campbell
 
Default Moving users from Debian-based distro to CentOS

On Mon, Aug 09, 2010, Keith Roberts wrote:
>On Mon, 9 Aug 2010, Gary Greene wrote:
>
>> To: CentOS list <centos@centos.org>
>> From: Gary Greene <ggreene@minervanetworks.com>
>> Subject: Re: [CentOS] Moving users from Debian-based distro to CentOS
>>
>> On 8/8/10 10:59 PM, "John R Pierce" <pierce@hogranch.com> wrote:
>>> 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).
>
>what about using the `find` command, and piggy-back
>the chown command on that?
>
>`pinfo find`
>

I find that it's fairly easy to migrate users from the old system
to the new by creating rsync modules for each user pointing to
the user's $HOME directory, then using rsync to copy everything
to the user's directory to the new system.

This does not require having the uid/gid the same on the two
systems, only that the user and group names be consistent. Here
are a couple of sample rsyncd.conf entries for this:

[bill_upd]
uid = bill
gid = csys
read only = false
path = /home/bill
comment = /home/bill
use chroot = yes
# only allow internal network
hosts allow = 192.168.253.0/24
hosts deny = *
list = no

[john_upd]
uid = john
gid = users
read only = false
path = /home/john
comment = /home/john
use chroot = yes
# only allow internal network
hosts allow = 192.168.253.0/24
hosts deny = *
list = no

Then a fairly simple loop on the source machine can copy/sync
each user's data from the old machine to the new one:

#!/bin/bash
for user in bill john; do
rsync -varP ~$user/ dstmachine::${user}_upd/
done

The rsync command takes care of the user/group mappings, and is
very efficient. One can make an initial run to get the bulk of
each user's files to the new machine, then do a final rsync just
before the cut-over adding ``--delete' to the rsync command to
get rid of any files deleted from the old machine since the
initial run.

We have used this to migrate ISP mail servers with thousands of
user's $HOME directories containing Maildir mail stores with
minimal down time. In this case, we created all the user
accounts on the new machine so their $HOME directories existed,
then did the rsync copies after switching the DNS for the mail
servers to point to the new machine. There was a fairly short
period in which users would see only new mail that arrived until
their Maildir folders had been completely copied. On a machine
with about 8,000 e-mail users, and gigabytes of data, it took a
bit more than an hour to rsync all the user's accounts.

Bill
--
INTERNET: bill@celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
Voice: (206) 236-1676 Mercer Island, WA 98040-0820
Fax: (206) 232-9186 Skype: jwccsllc (206) 855-5792

"I do not feel obliged to believe that the same God who has endowed us
with sense, reason, and intellect has intended us to forego their use."
-- Galileo Galilei
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 08-09-2010, 08:09 PM
Kwan Lowe
 
Default Moving users from Debian-based distro to CentOS

On Mon, Aug 9, 2010 at 1:47 AM, Dotan Cohen <dotancohen@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.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 08-09-2010, 08:12 PM
Kwan Lowe
 
Default Moving users from Debian-based distro to CentOS

On Mon, Aug 9, 2010 at 1:47 AM, Dotan Cohen <dotancohen@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.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 08-09-2010, 08:18 PM
Keith Roberts
 
Default Moving users from Debian-based distro to CentOS

On Mon, 9 Aug 2010, John R Pierce wrote:

> To: CentOS mailing list <centos@centos.org>
> From: John R Pierce <pierce@hogranch.com>
> Subject: Re: [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.

Yes, that's the easiest way if there are only a few users on
the system. The numeric UID's and GID's will still be on
each users files and directories they own. So it makes sense
to just create the user accounts with those UID's and GID's.

>From my Auto Linux Installer script:

# -------------------------------------------------- #
# Create test user account for rodney.

echo "Creating new user account for rodney"
echo "Adding rodney to audio group"
echo

useradd
--comment 'User test account'
--uid 505
--gid users
--groups audio
-M
rodney

# Create login password for rodney.
lusermod -P 'qazwsxe' rodney

# -------------------------------------------------- #

Kind Regards,

Keith Roberts

-----------------------------------------------------------------
Websites:
http://www.php-debuggers.net
http://www.karsites.net
http://www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------------
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 09:37 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org