- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- copying users to new 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
09-06-2005 06:58 AM
09-06-2005 06:58 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 07:04 AM
09-06-2005 07:04 AM
Re: copying users to new server?
there are a couple ways but none at the snap of the fingers.
idea 1) write a script to extract the password entries and create the useradd commands, tar the home directory, and rcp these file to the new server (as some other user other than root). On the new server execute this script as the root user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 07:05 AM
09-06-2005 07:05 AM
Re: copying users to new server?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 07:05 AM
09-06-2005 07:05 AM
Re: copying users to new server?
Generally, we used a script to add users.
You can try to copy the /tcb directory to the new server, making sure to ommit system accounts like root.
It will probably fail.
I recommend adding the users by script and setting and distributing passwords. You can go in afterwards into /etc/passwd and alter the numeric users to match what they were on the old system.
The /home directory, I recommend merely tarring it up and transferring it. In conjunction with my other recommendations, its likely that at least file ownership will be perserved, if not fully meeting your question objectives.
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
09-06-2005 07:06 AM
09-06-2005 07:06 AM
Re: copying users to new server?
After all is said and done, you need to run the command:
pwconv
to resynchronize the passwords with the trusted computing database.
You may end up with some locked accounts at the end of this, so keep a few root login windows open to unlock them if you run into this situation.
hope it helps
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 07:16 AM
09-06-2005 07:16 AM
Re: copying users to new server?
Best metod is using a script. copying the password file should work, but generate the home directory of the users accordingly.
see the script in the following post. But this is for a trusted system.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=952123
Regards,
Syam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 07:18 AM
09-06-2005 07:18 AM
Re: copying users to new server?
Use the /etc/passwd file if you are not trusted, otherwise make a file from the /etc/passwd and the files in /tcb/files/auth/? looks something like USER:PW_HASH:UID:GID:NAME_TEXT:SHELL
Then you can write a script around the useradd.sam command to read from that file and add the user. The line to actually add the user would look something like this:
/usr/sam/lbin/useradd.sam -u ${UID} -p ${HASH} -g ${GROUP} -m -k /etc/skel -s ${SHELL} -c "${NAME}" ${USER}
Then you could copy the home dirs with a command similar to:
remsh {REMOTESYSTEM} "cd /home;tar cf - ." | (cd /home; tar xf -)
Test that last command... I typed it from memory and that usually isn't a good thing.
JC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 07:22 AM
09-06-2005 07:22 AM
Re: copying users to new server?
Copy the /etc/passwd file from the old server
to /somedir/userinfo on the new server
created a script like this.
cat /somedir/userinfo |while read line
do
USER=$(echo $line|awk '{FS=":";print $1}')
PASS=$(echo $line|awk '{FS=":";print $2}')
USERID=$(echo $line|awk '{FS=":";print $3}')
GID=$(echo $line|awk '{FS=":";print $4}')
INFO=$(echo $line|awk '{FS=":";print $5}')
HOME=$(echo $line|awk '{FS=":";print $6}')
SHELL=$(echo $line|awk '{FS=":";print $7}')
echo "Adding $USER"
useradd -u $USERID -g $GID -s $SHELL -c "$INFO" -o -m -k /etc/skel -d $HOME $USER
/usr/sam/lbin/usermod.sam -p`echo "$PASS"` $USER
done
Run the script and your done
Home dirs will be the same.
UIDs will be the same.
Shells will be the same.
Groups will be the same.
Passwords will be the same.
Even any comments will be the same.
Have fun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 07:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 11:44 AM
09-06-2005 11:44 AM
Re: copying users to new server?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 11:49 AM
09-06-2005 11:49 AM
Re: copying users to new server?
Make sure the destination system does not have group numbers any different than source system as this may throw off the existing accounts and files' with these kinds of group memberships. Proceed with care is the best advice under these circumstances.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2005 11:57 AM
09-06-2005 11:57 AM