Wednesday, November 2, 2011

User and Group administration in AIX


User creation

Syntax:

mkuser

Example:

mkuser id=234 pgrp=aix su=true home=/home/abc gecos=”aix admin” abc

The same can be done by using smitty.

Changing user attributes

Syntax:

chuser

Example:

chuser gecos=”AIX team member” abc


Listing user attributes

Syntax:

lsuser (or) lsuser –f

Example:

lsuser –f abc

It will show you all the attributes of the user abc.

If you want to compare the attributes of two users, use the flag –c instead of –f followed by the user names.

lsuser –c abc, xyz

Changing shell of the user

Syntax:

chsh

Example:

chsh abc

It will show you the list of available shells. Type Yes then give the new shell.

Setting password to the username

Syntax:

passwd

Example:

passwd abc
Changing password for “abc”
abc’s new password:
Enter the new password again:

We can also use the command pwdadm to change the password.

Example: pwdadm

Note that the syntax is same as passwd command.

Deleting users

Syntax:

rmuser –p

Example:

rmuser –p abc

It will remove the user id from the server along with the password information.

Similarly general commands used for group activities are as follows.

To create a group

mkgroup

Example: mkgroup aixadmin

To change group properties

chgroup 

Example: chgroup users=sam,ram aixadmin

To delete a group

rmgroup

We can use –p flag to remove the key store values of a group and –R to remove the ldap information.

Example: rmgroup aixadmin

For detailed information, please go through the below link.






Saturday, October 29, 2011


Changing LV name online

Yes. We can change the LV name online in AIX 6.1 TL4.
Usually we will unmount the LV to rename it. But AIX 6.1 TL4 helps us to change the name of the logical volume online.

Steps:

1) Check the oslevel that it is in 6.1 TL4 (Just to ensure).

# oslevel -s
6100-04-01-0944

2) Note down the original LV name

# df -m /home/nmon
Filesystem    MB blocks      Free %Used    Iused %Iused Mounted on
/dev/nmonlv      256.00    254.73    1%       23     1% /home/nmon

# lsvg -l rootvg | grep nmon
nmonlv              jfs2       1       1       1    open/syncd    /home/nmon

3) Now, change the LV name without unmounting it.

# chlv -n nmon_lv nmonlv

Note that df output will not show us any change until we remount the file system. But we can see the new LV name in /etc/filesystems and “lsvg –l rootvg” outputs.

# df -m /home/nmon
Filesystem    MB blocks      Free %Used    Iused %Iused Mounted on
/dev/nmonlv      256.00    254.73    1%       23     1% /home/nmon

# lsvg -l rootvg | grep nmon
nmon_lv             jfs2       1       1       1    open/syncd    /home/nmon

# grep -p nmon /etc/filesystems
/home/nmon:
        dev             = /dev/nmon_lv
        vfs             = jfs2
        log             = /dev/hd8
        mount           = true
        options         = rw
        account         = false
        quota           = no

4) After remounting the filesystem, the df command now displayed the new LV name. 

# umount /home/nmon
# mount /home/nmon
# df /home/nmon
Filesystem    512-blocks      Free %Used    Iused %Iused Mounted on
/dev/nmon_lv      524288    521696    1%       23     1% /home/nmon