- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Users/groups copying to another server..
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2004 01:05 AM
02-05-2004 01:05 AM
Users/groups copying to another server..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2004 01:28 AM
02-05-2004 01:28 AM
Re: Users/groups copying to another server..
You may also want to copy /home, or where ever the users home directories are, over to the new machine as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2004 01:33 AM
02-05-2004 01:33 AM
Re: Users/groups copying to another server..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2004 01:35 AM
02-05-2004 01:35 AM
Re: Users/groups copying to another server..
I agree with Patrick. I have another thread with the same solution, but I lost it. :-(
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2004 01:47 AM
02-05-2004 01:47 AM
Re: Users/groups copying to another server..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2004 02:10 AM
02-05-2004 02:10 AM
Re: Users/groups copying to another server..
To check the passwd file consistency:
# pwck
To check the passwd file and the /tcb structure:
# pwck -s
or
# authck -p
To check the group file consistency:
# grpck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2004 02:15 AM
02-05-2004 02:15 AM
Re: Users/groups copying to another server..
Then cat /root/newusers >> /etc/passwd
Same thing for any new groups.
Then check consistency as noted in prior answers.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2004 06:09 AM
04-22-2004 06:09 AM
Re: Users/groups copying to another server..
Why is it that you null out the passwords when copying the file to a new host?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2004 07:54 AM
04-22-2004 07:54 AM
Re: Users/groups copying to another server..
it should run on the destination server
I assume remsh between the 2 servers otherwise use ssh and scp:
REMHOST=
USERS=$(remsh $REMHOST pwget | awk '{print $1}')
for i in $USERS
do
if pwget -n $i > /dev/null 2/dev/null
then
true # dont add this one as it exists already
else
PWLINE=$(rmesh $REMHOST pwget -n $i)
echo $PWLINE >> /etc/passwd
GRP=$(echo "$PWLINE" | cut -d: -f4)
if grget -g $GRP > /dev/null 2> /dev/null
then
true # dont add it line to group file
else
GRPLINE=$(remsh $REMHOST grget -g $GRP)
echo $GRPLINE >> /etc/group
fi
FIRST_CHAR=$(echo $i | cut -c1)
rcp -p $REMHOST:/tcb/auth/file/$FIRST_CHAR/$i /tcb/aauth/file/$FIRST_CHAR/$i
# copy content of hoemdir if you like
HDIR=$(remsh $REMHOS pwget -n $i | cut -d: -f6)
if [ ! -d $HDIR ]
then
mkdir -p $HDIR
rcp -p $REMHOST:$HDIR $HDIR
fi
fi # end of if pwget ....
done
If I didnt made typos and didnt mixed up the fields of passwd file or tcb dirs it should run.
I am not 100% sure if the rcp realy keeps user/group of the files. In one of the directios they might get resetted to root.
Better you try that before running the whole script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2004 08:00 AM
04-22-2004 08:00 AM
Re: Users/groups copying to another server..
replace 2nd line with
USERS=$(remsh $REMHOST pwget | cut -d: -f1)
instead of copying the complete homedirectories you could copy over just .profile or other single files.
You might also include a chown $i:$GRP $HOME
after the mkdir ... line.
regards
Juergen