Wednesday, December 2, 2009

User related commands in AIX


User related commands in AIX


id                To list all system identifications for current user

id -gn                To list the default group for current user

id -Gn                 To list all system groups for current user

lsuser root            To list the attribute of user root

lsuser ALL            To list the attributes of all users

lsuser -a ALL            To list all usernames 

lsuser -a HOME ALL        To list the home directory of all users

lsuser -a auth1 auth2 ALL        To list the authentication method for all users

lsuser -a expires ALL        To list expiry date

lsuser -a account_locked ALL     To check account lock status of all users

chuser -a login=true praveen        To enable the user praveen

chuser -a rlogin=true username        Enable user to login remotely to server 

mkuser praveen   Creates user si with default values in /usr/lib/security/mkuser.default

passwd   To change password of current user

passwd username  To change password of a user

pwdadm username  To change password of a user by security (admin) member

mkuser su=false username       Create user without su facility

rmuser username            To remove a user

rmuser -p praveen            To remove user praveen and his all attributes

who          List users with tty nos and ip numbers

who /var/adm/wtmp        Lists history of login logout system startup and shutdown

last root  All previous login and logoff time of root user

who -r     To list the current run level ( cat /etc/.init.state )

whoami   show current user

who am i         To list the exact user (who -m) ( ie. difference between su and su - After su shows previous username bcoz environment not set for current user and su - shows current username bcoz environment has been set)

mkgroup dcm            To create the group dcm

chgroup users=user1,user2,user3 dcm    To add users user1,user2 and user3 to dcm  group

rmgroup dcm            To delete the group dcm

chauthent            To change the authentication methods

chuser unsuccessful_login_count=0 username   To change the unsuccessful login count

pwdck -t ALL / Username  To verify user passwords ( Report error and ask to fix it)

usrck -t ALL / Username   To verify user definition.

grpck -t ALL / groupname  To verify a group




*************


Print commands in AIX

Print commands in AIX

switch.prt  -d    to Display current print subsytem (AIX, System V, BSD) 

switch.prt  -s AIX   to change current print subsytem to AIX 

switch.prt  -d systemV    to change current print subsytem to systemV

qprt -P  qname filename   To submit print jobs (AIX Printing)


qprt -P:lp1 filename   To submit a print job if multiple queue / printer is there 

qprt -N   No. of print copy required 

qchk -q                To display the default q

qchk -P lp0            To display the status of the printer lp0


qchk -# 123           To display the status of job number 123


qchk -A                To display the status of all queues (AIX Printing) 


qcan -x 123            To cancel the print job 123 (AIX Printing)

qcan -X -P lp0            To cancel all jobs submitted to lp0
(AIX Printing)

qchk -L  to show job priorities 

qpri -#570 -a 25            To change the priority of the job to 25

qhld -# 569            To hold the  job 569


qhld -r -#569            To remove holding job 569 (release)


qmov -m pq1 -#11        To move the job 11 to queue pq1


enable psq            To enable queue psq


disable psq            To disable queue psq


lp -d qname filename  To submit printjob (System V printing)

lp -n   No. of print copy required


lpstat                 To display the status all queues (System V printing) 

lpstat -p lp0            To display the status of print queue lp0

lpstat -u root            To display the jobs submitted by user root


cancel -#111            To cancel job 111
(System V printing)

lpq -P lp0            To display the status of queue lp0  ( BSD Printing )






************



Backup commands in AIX


Backup commands in AIX


mksysb -i -X /dev/rmt0        Creates image.data and system backup (-X expands /tmp if required)

mksysb -m /dev/rmt0        Creates image.data file with map file and system backup


mksysb -e /dev/rmt0        Creates system data but excludes the files listed in /etc/exclude.rootvg


mkszfile                Creates /image.data file


mkcd -d /dev/cd1            Creates system boot backup to the CD-R device /dev/cd1    (mksysb)



mkcd -d /dev/cd1 -v datavg        Creates  backup of VG datavg to CD-R device /dev/cd1   (savevg)


savevg -i -f /dev/rmt0 datavg    Creates datavg.data image file and backup vg datavg (path = /tmp/vgdata/datavg/datavg.data)



savevg -ef  /dev/rmt0 datavg        Creates datavg backup but excludes files listed in the /etc/exclude.datavg


find / -print | backup -ivf /dev/rmt0    Backup entire system to rmt0


backup -0vf /dev/rmt0 /home    Backup /home directory to rmt0 with backup level 0


restore -Tvf /dev/rmt0        List the archive in rmt0


restore -xvf /dev/rmt0 /home    Restore /home from archive in device rmt0


restore –xvf /export/mksysb ./etc/sshd.conf    Restores particular file from /export/mksysb image

restore -Pa -vf /dev/rmt0 ./etc/passwd    Restore only a file attribute from tape

 find ./home -print |cpio -ocvumB > /dev/rmt0  Archives /home directory 

cpio -icvdumB < /dev/rmt0  Restores cpio archive from rmt0

cpio -ivt < /dev/rmt0      List the contents of cpio archive from rmt0

cpio -icvd < /dev/rmt0 /home  Restores /home directory from rmt0


tar -cvf /dev/rmt0 /home        Archives /home to rmt0 device


tar -tvf /dev/rmt0            List the archives in rmt0


tar -xvf /dev/rmt0 /home        Extract /home from rmt0


dd if=file1 of=file2 conv=ebcdic    Convert and copy ascii file to ebcdic file2


dd count=1 bs=4k skip 31 seek=1 if=/dev/hd4 of=/dev/hd4    copy 31st block and paste to 1st block in the hd4 ( ie.to fix currupted superblock by restoring it's backup copy to original location)



dd if=/dev/rmt0 ibs=512 obs=1024 of=/dev/rmt1  To copy blocks from rmt0 with 512 blocks to rmt1 with 1024 blocks 


tctl -f /dev/rmt0 rewind        To rewind the tape


tctl -f /dev/rmt0 offline        To eject the tape


tctl -f /dev/rmt0 status        To show the status of tape

tcopy /dev/rmt0.0 /dev/rmt1.0   to copy contents of 1st tape(tape0) to 2nd tape(tape1). It is useful when the size of the tapes are different.


tcopy /dev/rmt0     to show no. of files and block size in the tape



chdev -l rmt0 -a block_size=512    To change the block size of the tape to 51201






******************



Tuesday, December 1, 2009

How to's in AIX

1) How to disable telnet in AIX

How to disable telnet in AIX

  
#vi /etc/inetd.conf

comment out telnet from this file (#telnet ... ... .. )

save it and

#refresh -s inetd

Then telnet session will be disabled in that server from now.


2) HOW TO FIX A CORRUPTED BLV IN AIX



3) HOW TO DO LINK AGREGATION IN AIX



4) HOW TO CONFIGURE NTP IN AIX
















Sunday, November 22, 2009

Short forms related to IBM AIX

IBM AIX acronyms


IBM         International Business Machines 

AIX        Advanced Interactive eXecutive (Advanced IBM uniX)

POWER   Performance Optimized With Enhanced RISC

RISC       Reduced Instruction Set Computing

CISC      Complex Instruction Set Computing

SCSI      Small computer Simple Interface

PCI       Peripheral Component Interconnect

ISA       Industry Standard Architecture

MCA     Micro Channel Architectural

CHRP    Common Hardware Reference Platform

SMP      Symmetric Multi Processor

PSSP     Parallel System Support Programs

LPAR    Logical PARtition 

HACMP  High Availability Cluster Multi Processing

RSCT   Really Scalable ( RS6000) Cluster Technology

P2SC   POWER2 Super Chips

RAS     Releability Availability Serviceability

SMP    Symmetric Multi Processing

NUMA   Non-Uniform Memory Access

MPP     Massively Parallel Processing

CMP    Chip Multi Processing

CAD   Computer Aided Design

CWS   Controll Work Station

ISB    Intermediate Switch Boards

SDR    System Data Depository

PVM   Parallel Virtual Machine

MPI   Message Passing Interface

HPF   High Performance FORTRAN 

HMC     Hardware Management Console

ASM     Advanced System Management

NIM      Network Installation Manager

LPP      Licenced program Product

BOS     Base Operating System

APAR    Authorized program Analysis Report

SMS     System Management Services

SRC     System Resource Controller 

JFS       Journaled File System

JFS2     Enhanced Journaled File System

CDRFS   CD-ROM File System

UDFS     Universal Disk Format Specification

CIFS      Common Internet File System

NFS      Network File System

NBPI     Number of Bytes Per Inode 

WSM    Web based System management

RMC     Resource Monitoring and Controll

DAT     Digital Audio tape

QIC     Quarter Inch Catridge

DLT     Digital Linear Tape

LTO     Linear tape Operation

TAR     Tape ARchive

CPIO   CoPy Input to Output 

DD      Device to Device

TCTL   Tape  ConTroL 

DCE    Distributed Computing Environment 

CDE    Common Desktop Environment

PPA    parallel Port Adapter

TCP/IP     Transmission Control Protocol / Internet protocol

DARPA    Department of Advanced Research Projects Agency

IAB      Internet Architecture Board

RFC     Request For Comments

LAN     Local Area Network

WAN    Wide Area Network

NIS     Network Infornation Services

DNS    Domain Name Service

DHCP   Dynamic Host Configuration Protocol

NCS     Network Computing System

ICMP    Internet Control Message Protocol

PING    Packet InterNet Gropher

ODM     Object Data Manager

SWVPD   SoftWare Vital Product Data

SRC    System Resource Controller

SMIT  System Management Interface Tool

PUN   Physical Unit Number

LUN   Logical Unit Number

LVM   Logical Volume Manager 

VGDA    Volume Group Descriptor Area

VGSA     Volume Group Status Area

LVCB    Logical Volume Control Block

LVDD  Logical Volume Device Driver

PDT    Performance Diagnostic Tool

SSH    Secured SHell

RSH    Restricted SHell 

EA       Extended Attributes

ACL     Access Controll List

TCB    Trusted Computing Base

SAK    Secure Authentication Key

SAN    Storage Area Network

NAS    Network Area Storage (by NFS)



******************