Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

duplicating user accounts

Status
Not open for further replies.

Fountainhead

Programmer
Joined
Dec 26, 2000
Messages
1
Location
US
I have a system with about 300 users on it. I'll be migrating them a dozen or so at a time to a new system. So I need to recreate their accounts on the new system.

I was wondering if anyone out there knew of a script that either 1) used lsuser or 2) parsed /etc/passwd /etc/groups ... to create a script that contains a series of mkuser commands.

I'm about to write my own, but didn't want to reinvent the wheel if I could help it.

Thanks.

Trent
 
Hi,

To duplicate the password and group entries from another AIX box, copy /etc/passwd, /etc/group,/etc/security/passwd,/etc/security/group,/etc/security/user,/etc/security/limits,/etc/security/environ. The last three are optional unless you modified them. If you modified /etc/security/login.cfg, you should also copy that file. -------- this was taken from the FAQ at "comp.unix.aix".....

hope it will help...
 
And do an
[tt]
for USER in $(lsuser -a id ALL | awk -F'=' '$2>200 {print $1}' | cut -f1 -d' ')
do
mkdir /home/$USER
chown $USER /home/$USER
done
[/tt]
... to reconstruct their home directories, or better: restore'em from a backup!.

I hope it works...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top