You are on page 1of 8

LINUX ALL ============ ========= LINUX BOOT ORDER =====================


Tape drive installation ========================= -dat-tape-drive-888071/ -258766/ =======> =======> cat /proc/scsi/scsi grep Ult* cat /proc/scsi/scsi grep Tape

SAN & WWN CONNECTIVITY ======================== [root@vfaul350 ~]# cat /proc/scsi/qla*/* grep adapter-port scsi-qla0-adapter-port=50060b0000881c92; scsi-qla1-adapter-port=50060b0000881c93; [root@vfaul350 ~]# cat /proc/scsi/qla*/* grep target scsi-qla0-target-0=50060e8004757902; scsi-qla0-target-1=50060e8004757922; scsi-qla0-target-2=50060e8004757923; scsi-qla0-target-3=50060e8004757942; scsi-qla0-target-4=50060e8004757962; scsi-qla0-target-5=50060e8004757963; scsi-qla0-target-6=100000e002433f02; scsi-qla1-target-5=100000e002233f02; ===================== QLOGIC DRIVER INSTALLATION IN LINUX ======================================== s-linux-hosts/

Time Zone Setting ======================== zdump -v /etc/localtime grep 2011 rpm -qi to check the status of package installed

hostname;rpm -qa grep tzdata tzdata-2006a-2.fc2.1 .html

=========================== The passwd command and passwd aging. The passwd command has the obvious use of changing passwords. Additionally, it i s used by the root user to: * * * * * ocked * Lock and unlock accounts (-l and -u) Set the maximum number of days that a password remains valid (-x) Set the minimum days between password changes (-n) Sets the number of days of warning that a password is about to expire (-w) Sets the number of days after the password expires before the account is l (-i) Allow viewing of account information in a clearer format (-S)

Login attempt from ip address and users ======================================= lastb less lastb -R less

Password Never expire command =================================

Login attempt failed and ssh Login status in Linux ================================================== hostname;tail -f /var/log/secure Sep 28 23:22:26 vfaul057 sshd[2333 ========================================================== How Do I Display All Failed Login Attempts For a User Called vivek? Type the command as follows: # faillog -u vivek To display all failed login attempt try: ========================================== faillog -a To display failed login attempt for user root with following command: ================================================================ $ faillog -u root

PAM Configuration To Recored Failed Login Attempts ======================================================= Task: Lock Account To lock user account to 180 seconds after failed login, enter: # faillog -l 180 -u vivek # faillog -l 180

Password chage after login

============================= chage -d 0 {user-name} # chage -d 0 tom Password Aging Never expiry ======================== chage -I -1 -m 0 -M 99999 -E -1 rt083742

Password Lock and unlock status ================================== [root@techpulp ~]# passwd -S mark mark PS 2009-01-21 0 99999 7 -1 (Password set, unknown crypt variant.) PasswordLess Account in Linux ================================== passwd -d test How to lock and unlock an user account in Linux ======================================== To lock a user account (liz) from logging in: [root@techpulp ~]# passwd -l liz To unlock a user account (liz): [root@techpulp ~]# passwd -u liz

SSHD password less authentication ===================================== Step 1 ssh-keygen -t rsa Step 2 Then copy file id_rsa file located .ssh/id_rsa Step 3 add id_rsa key in server which we want to access at .ssh/authorized_keys2 /home/user/.ssh/authorized_keys2 Done ssh key password less ====================================

Sudo privileges all and limited =================================

a) Allow jadmin to run various commands: jadmin ALL=/sbin/halt, /bin/kill, /etc/init.d/httpd b) Allow user jadmin to run /sbin/halt without any password i.e. as root without authenticating himself: jadmin ALL= NOPASSWD: /sbin/halt c) Allow user charvi to run any command from /usr/bin directory on the system de v02: charvi dev02 = /usr/bin/* =========== ====== LVM In Multipathing ====================== l %2FmultiBcs%2Fliaaimpbsclvm.htm

DISK SPACE ============== How to find large files and directories in Unix/Linux -unixlinux/ 1 find /export/home/mml/ -size +400000 sort 2 To find the files in a specific range, we can mention the size twice. Suppose we want to find top 10 disk utilizing files with sizes in the range of 400MB ~ 600 MB, you can use the following command: r head 3

<36 SMSC :/export/home/mml/tmp> find /export/home/mml/ -size +400000 -size -600000 sort -r head -10

========== CRON job A crontab contains entries for a cron job. Entries in the crontab are separated by newline characters. Each crontab contains six fields separated by spaces as s hown below: Minute Hour Day Month Weekday Command Each field is explained below: Minute: 0 ~ 59 Hour: 0 ~ 23 Day: 1 ~ 31 Month: 1 ~ 12 Weekday: 0 ~ 6 (Sunday to Saturday) Command: A shell file which you want to execute routinely or at a particular tim e. An example of a crontab job is shown below: 0 1 15 * * / ============================

Hard Disk health ======================= ols/ check the overall health: #smartctl -H /dev/sda #hdparm -tT /dev/hda

dmidecode output ================ ng-dmidecode-command/ WWN

========== $ cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.3 (Tikanga) $ cat /sys/class/scsi_host/host1/device/fc_host:host1/port_name 0x2100001c111111c1 $cat /proc/scsi/qla2300/1

tcpdump =============== # host // look for traffic based on IP address (also works with hostname if you' re not using -n) # tcpdump host # src, dst // find traffic from only a source or destination (eliminates one sid e of a host conversation) # tcpdump src # tcpdump dst # tcpdump net # proto // works for tcp, udp, and icmp. Note that you don't have to type proto # tcpdump icmp port // see only traffic to or from a certain port # tcpdump port 3389 Monitor all packets on eth1 interface #tcpdump -i eth1 #tcpdump -ni eth0 Monitor all traffic on port 80 ( HTTP ) #tcpdump -i eth1 'port 80'

Monitor all traffic on port 25 ( SMTP ) #tcpdump -vv -x -X -s 1500 -i eth1 'port 25' tcpdump: Monitor ALL eth1 Traffic Except My Own SSH Session #tcpdump -i eth1 -s 1500 port not 22 You can skip additional ports too: #tcpdump -i eth1 -s 1500 port not 22 and port not 53 You can also use ip or hostname: #tcpdump -i eth1 port not 22 and host

DNS traffic via dnstop ============================= How do I view dns traffic with dnstop? Simply, type the following command at a shell prompt to monitor traffic for eth0 interface: # dnstop {interface-name} # dnstop eth0 # dnstop em0 # dnstop -l 3 eth0 # dnstop -t -s eth0 * -s Track second level domains * -t Track third level domains

How to diffierenate from Local disks vs SAN ==================================== [root@saturn block]# ls -l /sys/block/*/device How to rescan Fiber Channel and SCSI storage Posted by linux on July 21, 2011 You can force a rescan for SCSI drives like this: echo - >/sys/class/scsi_host/host

Same for FiberChannel: echo 1? >/sys/class/fc_host/host Also, you can reboot the system to Rescan.