- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Creating user account similar to other system
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
Discussions
Discussions
Discussions
Forums
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
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
тАО12-29-2005 05:23 AM
тАО12-29-2005 05:23 AM
Creating user account similar to other system
I want to create a user account which i want to be similar like existing in one of our other servers. I want to create with same passwd ,username and home directory.
Can i copy the line from passwd file of that particular user account and can i add the same line by editing the password file on other server where i want to create user account by vipw command.
Advice me.
Thanks in Advance
Venkat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 05:28 AM
тАО12-29-2005 05:28 AM
Re: Creating user account similar to other system
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 05:40 AM
тАО12-29-2005 05:40 AM
Re: Creating user account similar to other system
Do make copies of the passwd file on each server just in case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 06:17 AM
тАО12-29-2005 06:17 AM
Re: Creating user account similar to other system
This approach can work on non-trusted systems. I would think there might be issues with the encryption algorythim on the password, but you should test it.
What about LDAP/NIS server?
That would simplify matters.
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
тАО12-29-2005 06:18 AM
тАО12-29-2005 06:18 AM
Re: Creating user account similar to other system
chown test:users test
but i observed test is getting some else user ownership of the same users group
Any suggestions to change ownership
Thanks
Venkat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 06:20 AM
тАО12-29-2005 06:20 AM
Re: Creating user account similar to other system
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 06:36 AM
тАО12-29-2005 06:36 AM
Re: Creating user account similar to other system
Hope the posting by others have helped in fixing your problem but you have not given any feedback to any of theanswers,people here spend time helping you out.
Rgds
HGN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 06:36 AM
тАО12-29-2005 06:36 AM
Re: Creating user account similar to other system
You wrote, "after copying the lines from one server and edited the other server passwd file with vipw...and after that i created directory under /home and tried to change the permissions of that directory by using command".
UNIX doesn't care about the login *name* as you supply it to 'chown'. What counts is the *uid* or the numeric user ID of the account. If you cut-and-pasted the whole line from the '/etc/passwd' file on the "source" server into the '/etc/passwd' file on the "destination" server then you may have duplicated a *uid* value. You need to make it unique.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2005 06:40 AM
тАО12-29-2005 06:40 AM
Re: Creating user account similar to other system
using the password file on the other server
as input.
cat passwd.from.other.server |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 -d $HOME -m -k /etc/skel $USER
/usr/sam/lbin/usermod.sam -p`echo "$PASS"` $USER
done
The useradd command should be all on one line