Labels

hpunix (63) marathi kavita (52) linux (21) solaris11 (10) AWS (5) numerology (5)

Monday, September 29, 2014

How to Disable Direct root SSH login + HPUX

How to Disable Direct root SSH login - HPUX

1. #find / -name "sshd_config"
/opt/ssh/etc/sshd_config
/opt/ssh/newconfig/opt/ssh/etc/sshd_config
/opt/ssh/src/ssh/sshd_config

# cd /opt/ssh/etc


#cat sshd_config |grep -i PermitRootLogin

PermitRootLogin yes

# vi sshd_config


2. vi the sshd_config file and change below line:

PermitRootLogin no

save and exit


3. Recheck the sshd_config file.


#cat sshd_config |grep -i PermitRootLogin

PermitRootLogin no

4. Then stop and restart SSH.


# /sbin/init.d/secsh stop


# /sbin/init.d/secsh start


You will not be able to do ssh as root now.




Thanks...
Kiran Jadhav


**Let's Share our knowledge and keep visiting here**

Thursday, September 25, 2014

What is PE (Physical Extents) + HPUX

What is PE (Physical Extents):

Extent is nothing but smallest allocatable unit of space in LVM. A physical volume is
broken into Physical Extents (PEs). One PE is the smallest unit of disk space you can allocate. 


The PE and LE sizes are set at the time of VG creation and they are consistent throughout a volume group. 
The default extent size is 4 MB.

Use of PE :


1. The PE size is only used for bookeeping, and has nothing to do with actual read or write performance. Smaller PE size allows more precise disk allocation. Larger PE size allows larger PV sizes, leading to larger VG maximum size.

2. WE use PE size to calculate total size of disk which can be allocated within that VG.

Max_PE_per_PV * PE size = Total disk size


admin_server:/] vgdisplay vg01 |egrep "PE Size|Max PE per PV"
Max PE per PV               4466
PE Size (Mbytes)            64

total size of disk = 
4466 * 64
285824
285824 / 1024
279

279 GB



Note : The maximum number of PE are in the range 1 to 65535 in 11.31.



Thanks...
Kiran Jadhav


**Let's Share our knowledge and keep visiting here**

New disk addition on HPVM - hpux

New disk addition on HPVM - hpux

The storage team will allocate a new lun to the VM HOST (Physical server).

We will be using that disk on VM guest. We can do this by two methods 
i.e either using that entire disk on HPVM guest.
or by creating a LV on HPVM host and using that LV as a disk on HPVM guest.


1. On HPVM Host ( Where the VM machine is running )


#ioscan -fnC disk

#insf -eCdisk

After identifying the disk:

{ For LV --

#pvcreate /dev/disk/rdisk??

#vgcreate /dev/vg_name?? /dev/disk/disk??

#lvcreate -L "disk size in MB" -n /dev/vg_name??/lv_?? /dev/vg_name??

(Create a RAW Lvol only , no need to create a FS, since we are going to allocate this RAW lvol as disk to HPVM) }




2. # /opt/hpvm/bin/hpvmstatus -P {VMguest} = To check existing disk details for the VM machine


For LV :

#hpvmmodify -P {VMguest} -a disk:scsi::lv:/dev//rdisk/diskxx


For Disk : 

#hpvmmodify –P {VMguest}  -a disk:avio_stor::disk:/dev/rdisk/diskxx


3. Once disk is added on HPVM guest; check and confirm: 

#/opt/hpvm/bin/hpvmstatus -P {VMguest} = to check the new added disk details in o/p



Thanks...
Kalyanjit

Tuesday, September 16, 2014

Screen utility uses + Unix

Screen utility uses:

The screen utility allows us to use multiple windows (virtual VT100 terminals) in Unix.

create a .screenrc file in your home directory

[linuxadmin]:/home/kiran> cat .screenrc
password LHeWP8H4CO4mY
defscrollback 10000
hardstatus alwayslastline "%{= d}%{r}[ %D %M %d ]%{-}%=%-Lw%{BW}%n*%f %t%{-}%+Lw %=%{g}[ %C %A %Y ]%{-}"


then run this utility by below command:

#screen


Note : Every screen command starts with Ctrl-a.

Various options:

Ctrl-a c Create new window (shell)

Ctrl-a k Kill the current window

Ctrl-a 0-9 Go to a window numbered 0-9

Ctrl-a n Go to the next window

Ctrl-a p Go to the previous window

Ctrl-a Ctrl-a Toggle between the current and previous window

Ctrl-a [ Start copy mode

Ctrl-a ] Paste copied text

Ctrl-a ? Help (display a list of commands)

Ctrl-a Ctrl-\ Quit screen

Ctrl-a D (Shift-d) Power detach and logout

Ctrl-a d Detach but keep shell window open



Thanks...
Kiran Jadhav


**Let's Share our knowledge and keep visiting here**

Friday, September 12, 2014

How to Identify failed disks + HPUX

How to Identify/validate failed disks:

1. By using ioscan command:

check the s/w state of the disk. If it is having claimed status means the disk is functioning and responding to controller. If it is having s/w status No_HW or Unclaimed means the disk is suspicious.

#ioscan -fnCdisk |grep -v claimed

2. By using diskinfo command

check the disk information like vendor, product ID, SIZE etc... If the size of disk is 0 means the disk is malfunctioning

#diskinfo /dev/rdsk/c0t1d2

3. Final check by using dd command:

Try to read small portion of disk by using dd command. We will not get any I/O error if the disk is functioning properly.

# dd if=/dev/rdsk/c0t1d2 of=/dev/null bs=1024k count=64
64+0 records in
64+0 records out




Thanks...
Kiran Jadhav


**Let's Share our knowledge and keep visiting here**

Wednesday, September 10, 2014

Waiting for welcome message. Access denied + ftp error

ftp user is getting below error while doing ftp:


Waiting for welcome message. Access denied:


Solution:

1. check the user attributes by command

#lsuser -f

2. If the user has tried wrong password then,make unsuccessful login count 0

#chuser unsuccessful_login_count=0

3. When we change password of particular user it will by default activate password attributes specified in the /etc/security/login.cfg file. like ADMCHG flag in /etc/security/passwd

ADMCHG flag = This forces the user to change passwords the next time a login command

As this is ftp user so it will be not able to change the password after first login so we have to disable the password attirbutes

#passwd username

#pwdadm -c

-c Clears all password flags for the user in the /etc/security/passwd file.


Thanks...
Kiran Jadhav


**Let's Share our knowledge and keep visiting here**

Friday, September 5, 2014

Tivoli commands


Few Tivoli Commands:

Tivoli is a monitoring tool...

1.  Command to check the status of agent
# /opt/IBM/ITM/bin/cinfo –r 

[root@testserver]# /opt/IBM/ITM/bin/cinfo -r

*********** Fri Jul 20 08:34:13 CDT 2012 ******************
User: root Groups: root bin daemon sys adm disk wheel sapinst
Host name : testserver  Installer Lvl:06.23.00.00
CandleHome: /opt/IBM/ITM
***********************************************************
Host           Prod  PID   Owner  Start  ID    ..Status
testserver  lz    3499  root   Jul17  None  ...running
testserver  ul    7918  root   Jul17  None  ...running


If agents (Unix logs ul & Linux monitoring agents lz)  are not running run following command to start

2. To start Unix Log agent
#/opt/IBM/ITM/bin/itmcmd  agent start ul   


3. To start Linux monitoring agent
#/opt/IBM/ITM/bin/itmcmd  agent start  lz  

Thursday, September 4, 2014

audsys error + HPUX

If we encounter below error on console after server reboot :


Must specify a backup file now !
current audit file size is 1469344 kilobytes!!!
an attempt to switch to the backup file failed.
Must specify a backup file now !
current audit file size is 1469344 kilobytes!!!
an attempt to switch to the backup file failed.
Must specify a backup file now !


Solution:

This error comes when audit file is full , so must specify next audit file. audsys captures audit records.

1. #audsys -f     -- to turn off auditing

2. #audsys -c filename     --- specify current aud file

OR #audsys -x filename      --- specify next aud file

    filename will gets appear into /.secure/etc/audnames

3. #audsys -n       --- turn on auditing



Thanks...
Kiran Jadhav


**Let's Share our knowledge and keep visiting here**

Printer commands + HPUX

Printer commands:

First check whether addqueue command is available on system or not?

# swlist | grep JetDirect


     addqueue: method of creating queues for printers connected with HP                              JetDirect interface cards.


usages: addqueue [-c class] [-d] [-i printerID] -q queuename -h hostname [-p             port] [-s] [-r on/off] [-t on/off] [-b on/off] [-L                    PS/PCL/HPGL/HPGL2/AUTO] [-P 1/2/3] [-T 1/2/3] [-m banner papersize] [-D      on/off]

  #addqueue -q {kirprint}  -h {printer IP}  -i 9998

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

Here printer name is "kirprint"


1) #/usr/sbin/lpstat –tkirprint


  This will show the printer status and the queued jobs for this printer

2) #/usr/sbin/lpstat -okirprint

  This will give you the list of jobs queued for the printer


3) #banner TEST |lp -p 7 -d
kirprint|lpstat -okirprint


  Use this command to give test print,where
  p-- priority..here 7 has highest while 0 has lowest priority
  d-- destination printer name


4) #lpshut


   It will shutdown the lp spooler.


5) #lpsched


    It starts the lp spooler.The activity of the process is recorded in /var/adm/lp/log.


/var/spool/lp LP spooler system parent directory. All information about the
setup and printing queues is located here.


/var/spool/lp/request Destination queues. This is where all lp requests are queued. It usually contains a subdirectory for each printer configured
on the system.

6) After creating printer check the printer status by:

#lpstat -p{printer name}


Thanks...
Kiran Jadhav

**Let's Share our knowledge and keep visiting here**

Tuesday, September 2, 2014

How to reduce size of a FileSystem + HPUX

How to reduce size of a FileSystem :

mount point : /kirdata
LV Name: /dev/lvol2/kirdata
Total size: 15G
Need to reduce FS by 5GB so new size will be 10GB


Solution:

1. Take backup of particular FS

2. OnLineJFS must be installed on your system

    #swlist | grep -i OnLineJFS

If yes...

3. Defragment the mount point: 

   #fsadm -F vxfs -d -D -e -E
  #fsadm -F vxfs -d -D -e -E /kirdata

-d Reorganizes directories. 

-D Reports on directory fragmentation.

-e Extent reorganization. 

-E Reports on extent fragmentation. 

4. Reduce the filesystem:

#fsadm -b

#fsadm -b 10240M /kirdata   

5. Reduce the logical volume:

#lvreduce -L

#lvreduce -L 10240M /dev/lvol2/kirdata


6. To verify :

It should display new size of LV:

#lvdisplay /dev/lvol2/kirdata


Thanks...
Kiraan B Jadhhav


**Let's Share our knowledge and keep visiting here**

Monday, September 1, 2014

Health Tips

Health Tips:

Few days before I watched videos of Rajiv Dixit on youtube and came to know few health tips which will work 100%:

By following below tips one will definitely lose weight without doing exercise. Doing exercise is always beneficial :-)

1. In the morning,  once you wake up the first thing you should do is drinking 1 - 1 and 1/2 ltr water.

2. Always drink water sip by sip by taking saliva inside.

3.  Drink water by keeping 1 and 1/2 hour gap after taking heavy breakfast/lunch/dinner. It will help your digestion process.

4. Do not drink water while eating food. strictly avoid it.

5. Try to drink water in sitting position.



Thanks...
Kiran Jadhav


**Let's Share our knowledge and keep visiting here**