Sunday 17 March 2013

Cheat Sheet for AIX User-related Commands


Many administration activities that work on other UNIX-derived operating systems, such as Linux and Solaris, work without change on AIX. But user administration commands are an exception. IBM has its own unique commands that operate similarly to legacy UNIX, but you have to know the equivalents. For example, rather than the UNIX standard "adduser" command, AIX has "mkuser." This cheat sheet gives you a quick guide to the differences so that you can exploit user administration tools and techniques you find in user forums and elsewhere on the web. 
Here's a list of the most common UNIX user commands and their AIX equivalents:
FunctionUNIX CommandAIX Command
Create a useruseraddmkuser
Change a userusermodchuser
Delete a useruserdelrmuser
Change user's shellusermod -schsh or passwd -s
Lock a user's accountpasswd -lchuser login=false





Other user-oriented commands are nearly the same on AIX as its UNIX brethren:
FunctionAIX Command
Change passwordpasswd
Display current user detailswhoami
List users currently logged inwho or w
One thing AIX is famous for is giving administrators powerful commands that other UNIX variants lack. For user admin, AIX has the following unique yet useful commands. For example, to list all the users on the system, UNIX admins can only dump the /etc/passwd file. And to add or remove a users from a privilege control file, such as /etc/ftpusers, standard UNIX calls for directly editing the file—introducing the possiblity of devastating syntax errors. AIX has dedicated commands for these actions. Here's a summary of AIX "power" user commands:
FunctionAIX Command
List user account detailslsuser <username>
List all userslsuser ALL
Print a table of specific user attrbuteslsuser -a ALL
Check integrity of user accountsusrck -t ALL
Add or delete user in /etc/ftpusers fileruser -a -f or ruser -d -f
Add or delete user in /etc/host.lpd fileruser -a -p or ruser -d -p
Add or delete user in /etc/hosts.equiv fileruser -a -c or ruser -d -c
Show all users in /etc/ftpusers fileruser -s -F (note upper-case)
Show all users in /etc/host.lpd fileruser -s -P (note upper-case)
Show all users in /etc/hosts.equiv fileruser -s -R (note upper-case)
Armed with this cheat sheet, you're ready to begin adapting scripts and tricks from other UNIXes for your own AIX edification!

No comments:

Post a Comment