Tuesday, March 21, 2017

Users not able to login after reboot/migration

This would happen if the account got locked after 14 failed logins.  Please remember that there might be many sessions/terminals for the same user which would make this happen. To resolve this please follow the below steps :

# pam_tally --user=orauser --reset           (or)

# pam_tally2 --user=orauser --reset   (Orauser is the username)

Sunday, March 19, 2017

To Recover VxVM configuration if VxVM has been reinstalled on HP-Ux


  # rm /etc/vx/reconfig.d/state.d/install-db

  # vxconfigd -m disable

  # vxiod set 10

  # vxdctl init

  # vxconfigd -k -m enable

  # vxdctl initdmp

  # nohup /etc/vx/bin/vxrelocd root & (VxVM ONLY)

  # nohup /usr/sbin/dgcfgdaemon &

  # vxprint        (to see group and volume states)

  # vxrecover      (to recover volumes - if needed)

  # vxrecover -s   (to start volumes -if needed)





How to create rootdg manually without using vxinstall  HP-Ux

Install VXVM

Start vxconfigd in disabled mode
#vxconfigd -m disable

Start some vxiod threads
#vxiod set 10

Initialize the /etc/vx/volboot file
#vxdctl init

Create rootdg
#vxdg init rootdg

Initialize a disk for VM
#vxdisk -f init <device> type=simple

Add the disk to rootdg
#vxdg -g rootdg adddisk disk01=<device>

To enable vxconfigd daemon
#vxconfigd -k -m enable

To restart subsystem
#vxdctl initdmp

To start vxrelocd daemon on full VXVM
#nohup /etc/vx/bin/vxrelocd root &

Make persistent across reboots
#rm /etc/vx/reconfig.d/state.d/install-db

To start dgcfgdaemon
#nohup /usr/sbin/dgcfgdaemon &

How to grow disk size in SDS Solaris

1) Identify the free disk, volume size and metadevice name.
   #df –h
   /dev/md/dsk/d19         27G   1.5G    25G     6%    /bkup

2) Increase the /bkup by 10GB
   # metattach  d19 c4t50060E80000000000000818D00000009d0

3) Verify the volume size
   #metastat d19

4) Increase the file system  /bkup by 10Gb
   #/usr/sbin/growfs  -M /bkup  /dev/md/rdsk/d19

5) Verify the file system
   #df-h
Disk Cloning on Solaris


1)  Install the Disk

2)  Primary Disk c0t0d0s2
     #dd if=/dev/dsk/c0t0d0s2 of=/dev/dsk/c0t1d0s2 bs=256k

3)  Verify the clone disk has clean filesystem
      #fsck -y /dev/rdsk/c0t1d0s0 

4)  Mount the clone disk
      #mount /dev/dsk/c0t1d0s0 /mnt

5)  Make the clone entry in /etc/vfstab
      #vi /a/etc/vfstab

6)  Boot the clone disk


System Security on Solaris 


1)  Latest patches  (Download from Oracle Site)
    # patchadd <patchname>

2)  Access to the System :
     /etc/default/login
      sshd.config

3)  Limited su (Super User) acess.

4)  Stop unnecessary service at run level
    /etc/inetd.config : finger, discard, daytime, charger, tftp etc

5)  Make the below changes in Kernel file
     vi /etc/system
     user_exec_stack=0
     user_exec_stack_log=0
     set noexec_user_stack=1
     set noexec_user_stack_log=1

6)  Make the changes in shadow file
      vi /etc/shadow
      system - put as LK
      uucp - Put as LK

7) Create the Entry for the logs
     vi /etc/default/cron  - Create a file if not there
     CRONLOG=YES
   

Thursday, March 16, 2017

Re-labeling a disk on Solaris 


1)   To redirect  PRTVTOC output to a file
     
      # prtvtoc /dev/dsk/c0t0d0s0 > /tmp/ab1

2)  To copy the contents of VTOC from one disk to other
     
      # fmthard -s /tmp/ab1 /dev/rdsk/c0t3d0s2

Wednesday, March 15, 2017

Setting Label for Boot Device on Linux



1) Create label for boot

# e2label /dev/sda1 boot

2) Ensure Label is set for boot device

# e2label /dev/sda1
# blkid | grep boot

3) Edit /etc/fstab for boot as below and save it

# vi /etc/fstab
LABEL=boot                 /boot                ext3       acl,user_xattr        1 2

4) Reboot the server

# reboot
Installing Traceroute package on Ubuntu Linux



1) Download the package and Install it
root@lnxvra001:~# sudo apt-get install traceroute
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  traceroute
0 upgraded, 1 newly installed, 0 to remove and 126 not upgraded.
Need to get 57.0kB of archives.
After this operation, 205kB of additional disk space will be used.
0% [Connecting to us.archive.ubuntu.com]
0% [Connecting to us.archive.ubuntu.com]^C
root@lnxvra001:~#


2) Telnet does not work by default on Ubuntu Systems, Use the below command to check the ports on specific host/server.

root@lnxvra001:/var/tmp# nc -zv 10.254.51.27 1501
Connection to 10.254.51.27 1501 port [tcp/*] succeeded!
Configuring DHCP on Linux RHEL 7


1) Install the DHCP packages
#yum install dhcp*

2) To view the sample conf file
#vim /usr/share/doc/dhcp*/dhcpd.conf.example

3) Configuring DHCP  (get the domain and range details prior)
#vim /etc/dhcp/dhcpd.conf

      subnet 174.166.0.0  netmask 255.255.255.0 {
      range 174.166.0.10  174.166.0.90;
      option domain-name-servers ns1.shakthi.com;
      option domain-name    shakthi.com;
      option routers 174.166.0.1;
      default-lease-time  600;
      max-lease-time  7200;
}

4) Restart and enable the Service.
#systemctl restart httpd
#systemctl enable httpd


How to limit the bandwidth of Non-global zone on Solaris 10


1) To find the network interface and the speed

bash-3.2# dladm show-dev
e1000g0         link: up        speed: 1000  Mbps       duplex: full
e1000g1         link: up        speed: 1000  Mbps       duplex: full


2) The below command will set the bandwidth to 400 Mbps.

bash-3.2# dladm set-linkprop -p maxbw=400 zonename(replace with local zonename)




Tuning the File system on Solaris


1) # newfs -m 1 /dev/rdsk/c0t1d0s0
will create the file system, with the minfree value as 1%

2) bash-3.2# fstyp -v /dev/dsk/c0d0s7 | grep -i min   (% of space reserved for each slice)
minfree 1%      maxbpg  2048    opti   time

3) If 10%, we can change to 1% using below :

   To change the minfree value:
# tunefs -m 1 /dev/dsk/c0t2d0s0
minimum percentage of free space changes from 10% to 1%
How to check the server is physical or Virtual


Windows

From cmd prompt : Systeminfo

HP-Ux

/usr/sbin/swlist | grep "Virtual Partitions"

Solaris

bash-3.00# prtdiag -v | head -3
System Configuration: VMware, Inc. VMware Virtual Platform

Linux

#dmidecode -s system-product-name
#lspci | grep -i vmware