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

what is the command to rename a userid on AIX 5.1

Status
Not open for further replies.

strikelit

MIS
Sep 10, 2003
88
US
I need to rename a userid. What command do I use to change smithjr to jrsmith.
 
I don't think their is a command. I could be wrong.


You may have to vi /etc/passwd, /etc/security/passwd/, /etc/security/user,/etc/security/group .... with that said, I really don't know :)
 
As far as I know you can't.

You have to create a new user with the same permissions.

Nightmare for file ownership....
 
You can't from an existing command

To do this, the best way is:
- remove the user ( rmuser <username> )
- add again the user ( mkuser )
- rename the directory to the new name.
- change the owner of the directory ( and all files and subdirectories )to the new user

or edit files

/etc/passwd
/etc/security/environ
/etc/security/limits
/etc/security/user
/etc/security/user.roles
/etc/security/audit/config
/etc/group
/etc/security/groups

and create a new crontab or rename in /var/spool/cron/crontabs

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Simply save their encrypted password information
lsuser current user > /tmp/file1
grep -p current user /etc/security/passwd egrep "password|lastupdate" >/tmp/file2
rmuser -p curent user
mkuser "correct arguments" new user [ user /tmp/file1 to get the arguments,changed for the new user name ]
Passwd new user [set to arbitrary]
Pwdadm -c new user [ clear change flag ]
Vi +new user: /etc/security/passwd
Delete the password and lastupdate field, then read in /tmp/file2

If the user has a crontab, you will have to move it by hand.
If the user has a mail file, you will have to move it by hand.
If the home dir is name specific, you will have to move it by hand.
You may also need to update /etc/ftpusers /etc/ftpusers.allow $cronallow
$atallow
 
Try removing that user (smithjr) and create another user with the same User ID but with a user name as jrsmith.

(of course you may have to do some of the stuff the guys mentioned above manually)

Regards,
Khalid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top