Sunday, 19 June 2016



SOME AIX COMMANDS WE NEED TO PERFORM ON REGULAR BASIS :

1.     TO FIND LARGER FILES
For example say larger than 50mb

find /var -xdev -size +$((2048*50)) -exec du -am {} \;

The above example queries all the files in /var and prints file larger than 50MB with their size we can user any file system in place of var and any size in place of 50

2.     TO ADD A ENTRY IN /etc/inittab FILE

For example :

cp -p /etc/inittab /etc/inittab.bak.<todays date>
mkitab -i rcnfs "cons:0123456789:respawn:/usr/sbin/getty /dev/console"
The above example adds a respawn entry below the rcnfs id






3.     TO PROVIDE SUDO ACCESS FOR COMMAND TO A USER

Cmnd_Alias   <alias>= <path of command>
<user name> LOCAL = (root) <alias>
For example :
Cmnd_Alias ATR = /opt01/app2/oracle/eprodrdb/grid.11202/bin/srvctl
oraprodr LOCAL = (root) ATR

The above example provides “/opt01/app2/oracle/eprodrdb/grid.11202/bin/srvctl” root level  access to user oraprodr

4.   CREATING A LIST OF IOSLEVEL ON ALL THE VIO SERVERS PROVIDED THAT THE LIST OF VIO SERVER IS INSIDE /tmp/vioserverlst

For example :

for x in $(cat /tmp/vioserverlst)
do
ping -c 1 $x
if [ $? == 0 ]
then
levl=$(ssh $x /usr/ios/cli/ioscli ioslevel)
echo "$x , $levl" >> /tmp/viocurrentios
else
echo "$x could not pe pinged or contacted" >> /tmp/viocurrentios
fi
done
The above example stores the list of vioserver and their ioslevel in file /tmp/viocurrentios

5.   UNLOCKING A USER PASSWORD
For example :

usd=<type  your user name here >
chsec -f /etc/security/lastlog -a "unsuccessful_login_count=0" -$usd
chuser "account_locked=false" $usd
In the above example just type your user name in place of “type  your user name here” and copy and paste the three lines on aix screen
The user will be unlocked 

No comments:

Post a Comment