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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing username in AIX 5.3

Status
Not open for further replies.

balajipn

Programmer
Mar 30, 2004
65
IN
Hi,

I want to change the username of a unix user. Can some one tell me how to do it? I am part of the security group.

I don't want to edit the /etc/passwd file to overwrite the username.

Thanks,
Balaji.
 
no can do in AIX I'm afraid...

either delete and recreate, but keep the uid the same and then afterwards do all the changes to the user again (backup copy of shadow passwd, user, limits, ... files is a prereq)

or edit all files /etc/passwd /etc/security/passwd /etc/group /etc/security/group /etc/security/user /etc/security/limits ... manually.


HTH,

p5wizard
 
p5wizard said:
delete and recreate
I second that. It's reasonably safe if you use
Code:
lsuser oldname # this gets the user details
rmuser -p oldname # remove the old user
mkuser id=<old id> gecos=<old gecos> etc... newname #recreate with the old values
cd /home/olduser
cp -rp * ../newuser #transfer all their files to their new home directory
You may have to be careful which attributes you copy. uid, pgrp and groups are given, the gecos may well change with the new username. Use you skill and judgement with the rest.

You would also be best doing this as root


On the internet no one knows you're a dog

Columb Healy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top