Thursday, 19 July 2012

SOME MAIN THINGS TO KNOW

Disable Telnet,RSH,FTP & rlogin in AIX

Example for telnet. 

Edit the following file

#vi /etc/inetd.conf
  comment out telnet from this file (#telnet ... ... .. )
save it and exit from editor


Restart the
inetd services

#refresh -s inetd

Then telnet is disabled in the server now.
Same steps for other services too.... ) 

To view failed login user name in readable format 

# who -a /etc/security/failedlogin
root        ssh         Jul 12 12:46     (172.16.11.2)
root        ssh         Jul 12 12:47     (172.16.21.93)
root        ssh         Jul 12 12:47     (172.16.28.93)

How to Listing and changing the current boot order in AIX

bootlist -m normal -o              - Lists the current bootlist
bootlist -m normal cd0 hdisk0   - To set cd0 and hdisk0 as first and second boot devices
bootlist -m service cd0 rmt0    - To change the bootlist for service mode

To find out whether a Hard drive is bootable

# ipl_varyon -i
 PVNAME        BOOT DEVICE     PVID                                            VOLUME GROUP ID
hdisk0          YES             00c898eb372ea9410000000000000000        00c898eb00004c00
hdisk1          YES             00c898eb38483a300000000000000000        00c898eb00004c00
hdisk2          NO              00c898bbdd86318c0000000000000000        00c898bb00004c00

Change Network speed in AIX

To change the Network Card (NIC) speed in AIX, follow the steps given below.

# ifconfig en0 down detach

# chdev -l ent0 -a media_speed=......

# ifconfig en0 up 

  NIC Details 

  # entstat -d <network interface id>
To find out the network interface id, issue the command:
# ifconfig -a
Few ways to find mac address of a network card:
# ifconfig -a (as root)
# lscfg -vl <network card id> (for AIX)
# netstat -v
# entstat <network card id> (for AIX)
Mac address is 12 hexadecimal digits (digits 0-9 letter a-f) in six
pairs of digits separated by colons ( example: 00:02:53:d5:c7:28 ).
netstat -ia

FRU - Field Replacement Number

For replacing the devices, FRU is needed to know about it
lscfg -vpl hdisk*
lscfg -vpl ent*
# lscfg -vpl hdisk2
  hdisk2           U7311.D20.065CC3B-P1-C04-T2-L8-L0  16 Bit LVD SCSI Disk Drive (73400 MB)
        Manufacturer................IBM
        Machine Type and Model......ST373207LC
        FRU Number..................03N6325
        ROS Level and ID............43373046
        Serial Number...............00093810
        EC Level....................H13979
        Part Number.................26K5533
        Device Specific.(Z0)........000004129F00013E
        Device Specific.(Z1)........0721C70F
        Device Specific.(Z2)........0002
        Device Specific.(Z3)........06354
        Device Specific.(Z4)........0001
        Device Specific.(Z5)........22
        Device Specific.(Z6)........H13979

  PLATFORM SPECIFIC
  Name:  sd
    Node:  sd
    Device Type:  block

Stickey Bit
              
                The Sticky Bit is usually associated with world writeable directories, such as the /tmp directory. This prevents users from deleting files they don't own. Users can write to those directories but only they can delete or update those files they own. It's commonly used for scratch directories like /tmp to provide some security for otherwise world-writable directories.
Chmod u+t directorynam
ls –la /tmp ------directory will have stickey bit….rwxrwxrwt  

Zipping / taring the directory structure

zip -r file.zip file  -- zipping the file/girectory
unzip file.zip   -- unzip
tar -cvf file.tar file   -- tar
tar -xvf file.tar    -- untar
tar -czvf file.tgz file   -- tar with gunzip
tar -xvfz file.tgz   -- untar with gunzip

using java jar
/usr/local/java/bin

sudo /usr/local/java/bin/jar -xvf /ibm/temp/test.zip

Hard Link

when a file is copied, both the original and copy occupy separate space on the disk.
unix allows a file to have more than one name and yet maintain a single copy on the disk. The file is then said to have more than one link or name, but all have the same inode number. This is called hard link. All attributes are identical any modification or change in one file is automatically available in the linked file. It provides some protection against accidental deletion. Let there be a file named restore.sh. You need to create another file which provides as backup to the original file. By creating a link, you create a backup.
unix command used to create hard link >>ln- backup.sh restore.sh

Soft Link

It doesn't have the file's content but simply provids pathname of that automatically has the contents. This is called as softlink. but incase the original file is deleted we can't get the file's content from the linked file, coz, it just provides the path name of the file. This is also known as symbolic link. Windows shortcuts are more like symbolic links. The original file and the linked files have different inode nos.
Unix command used to create soft link>>ln-s 

Ex.Maximum no.of process allowed per user

# lsattr -El sys0 ( even you can grep certain parameters) maxuproc, realmem
SW_dist_intr    false              Enable SW distribution of interrupts              True
autorestart     true               Automatically REBOOT system after a crash         True
boottype        disk               N/A                                               False
capacity_inc    1.00               Processor capacity increment                      False
capped          true               Partition is capped                               False
conslogin       enable             System Console Login                              False
cpuguard        enable             CPU Guard                                         True
dedicated       true               Partition is dedicated                            False
ent_capacity    2.00               Entitled processor capacity                       False
frequency       528000000          System Bus Frequency                              False
fullcore        false              Enable full CORE dump                             True
fwversion       IBM,SF240_320      Firmware version and revision levels              False
id_to_partition 0X0475A01837ACB103 Partition ID                                      False
id_to_system    0X0475A01837ACB100 System ID                                         False
iostat          false              Continuously maintain DISK I/O history            True
keylock         normal             State of system keylock at boot time              False
log_pg_dealloc  true               Log predictive memory page deallocation events    True
max_capacity    4.00               Maximum potential processor capacity              False
max_logname     9                  Maximum login name length at boot time            True
maxbuf          20                 Maximum number of pages in block I/O BUFFER CACHE True
maxmbuf         0                  Maximum Kbytes of real memory allowed for MBUFS   True
maxpout         0                  HIGH water mark for pending write I/Os per file   True
maxuproc        2048               Maximum number of PROCESSES allowed per user      True
min_capacity    1.00               Minimum potential processor capacity              False
minpout         0                  LOW water mark for pending write I/Os per file    True
modelname       IBM,9133-55A       Machine name                                      False
ncargs          6                  ARG/ENV list size in 4K byte blocks               True
nfs4_acl_compat secure             NFS4 ACL Compatibility Mode                       True
pre430core      false              Use pre-430 style CORE dump                       True
pre520tune      disable            Pre-520 tuning compatibility mode                 True
realmem         7274496            Amount of usable physical memory in Kbytes        False
rtasversion     1                  Open Firmware RTAS version                        False
sed_config      select             Stack Execution Disable (SED) Mode                True
systemid        IBM,0306267CH      Hardware system identifier                        False
variable_weight 0                  Variable processor capacity weight                False

To alter: ( nsystem level not user level)

chdev -l sys0 -a maxuproc='2000'

or
smity
Goto 'Systems environments'
Goto 'Change/Show Characteristics of Operating System'
Goto 'Maximum number of PROCESSES allowed per user'

How to clear Amber ( Yellow ) Light on IBM POWER systems

This is one of the most common asked question from my customers:

There are only few steps to clear this false indicator , but before doing that you have to make sure that it is really a false alarm. You can do it by checking for latest errors in AIX error log . If there are no errors of Type P and Class H, then you can go for following steps

Type diag
Choose task selection
Choose indentify and attention indicators
Choose the indicator with the attention then choose set system
indicartor to normal

* Source Article from : Internet