Monday, November 25, 2013

HP 9000 Servers - HP-UX Command to Check System for 32/64 Bit Configuration

HP 9000 Servers - HP-UX Command to Check System for 32/64 Bit Configuration

Issue

The document contains information on the HP-UX command that checks the system for 32 bit or 64 bit configuration.

Solution

To check the CPU Hardware Support, use the following:

# getconf HW_CPU_SUPP_BITS  
32    
The result will be 32 , 32/64 or 64.
To check the Kernel Support, use the following:

# getconf KERNEL_BITS  
32    
It shows that the system has a 32 bit CPU and running on a 32 bit Kernel.

Friday, November 22, 2013

Linux NFS Server Configuation

Linux NFS Server Configuation

NFS Server Configuration File

The /etc/exports file controls which file systems are exported to remote hosts and specifies options. Blank lines are ignored, comments can be made by starting a line with the hash mark (#), and long lines can be wrapped with a backslash (\). Each exported file system should be on its own individual line, and any lists of authorized hosts placed after an exported file system must be separated by space characters. Options for each of the hosts must be placed in parentheses directly after the host identifier, without any spaces separating the host and the first parenthesis.
A line for an exported file system has the following structure:
<export> <host1>(<options>) <hostN>(<options>)...

For example, the following two lines do not mean the same thing:
/home bob.example.com(rw)
/home bob.example.com (rw)

The first line allows only users from bob.example.com read/write access to the /home directory. The second line allows users frombob.example.com to mount the directory read-only (the default), but the rest of the world can mount it read/write.

Starting and Stopping NFS

To run an NFS server, the portmap service must be running. To verify that portmap is active, type the following command as root:
# /sbin/service portmap status
To stop the server, as root type:
# /sbin/service nfs stop

The restart option is a shorthand way of stopping and then starting NFS. This is the most efficient way to make configuration changes take effect after editing the configuration file for NFS.
To restart the server, as root type:
# /sbin/service nfs restart
The condrestart (conditional restart) option only starts nfs if it is currently running. This option is useful for scripts, because it does not start the daemon if it is not running. 
To conditionally restart the server, as root type:
# /sbin/service nfs condrestart

To reload the NFS server configuration file without restarting the service, as root type:
# /sbin/service nfs reload

Monday, November 18, 2013

Enable or Disable an Iptables Firewall in RedHat

Enable or Disable an Iptables Firewall in RedHat


To start iptabes on your RedHat server:
# service iptables start

To stop iptabes on your RedHat server:
# service iptables stop

To save your iptables configuration so that it is loaded again on the next reboot:
# service iptables save

To start iptables on boot:
# chkconfig iptables on

Friday, November 15, 2013

How to use yum?

How to use yum?

Displays a list of packages that need to be updated:
# yum check-update

Install these updates:
# yum update

List all available packages:
# yum list available
# yum list available "package-name"

List all installed packages:
# yum list installed

Install the specified RPM or packages via RHN:
# yum install package-name
# yum install httpd

Remove the specified RPM(s) and it's dependents:
# yum remove package-name
# yum remove httpd

HP 9000/800/L3000-8x - Disk Module LEDs

HP 9000/800/L3000-8x - Disk Module LEDs





Thursday, November 14, 2013

How to set the never expire password to the user in HP-UX and Linux?

How to set the never expire password to the user in HP-UX and Linux?

HP-UX

For trusted system:

# /usr/lbin/modprpw -m exptm=0,lftm=0,mintm=0,expwarn=0,llog=0 username

For non-trusted system:

passwd -x -1 username

This doesn't work on 11.11.


It is the same command in all HP-UX systems and you can use SAM also to do this.

SAM>>Users & accounts >> users>>username 

Select the user and go to action menu then go to modify securities policy.


Linux


/etc/shadow stores actual password in encrypted format for user’s account with additional properties related to user password.
The password expiration information for a user is contained in the last 6 fields. Password expiration for a select user can be disabled by editing the /etc/shadow file
The chage command changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change his/her password.
# chage -l username
# chage -l bliu
Last password change                                    : Oct 18, 2013
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7

To disable password aging / expiration for user foo, type command as follows and set:
Minimum Password Age to 0
Maximum Password Age to 99999
Password Inactive to -1
Account Expiration Date to -1
Interactive mode command:

# chage username

or

chage -I -1 -m 0 -M 99999 -E -1 username

How do I start / stop / restart postfix mail server under Red Hat Linux operating systems?

How do I start / stop / restart postfix mail server under Red Hat Linux operating systems?

Postfix is a free and open-source mail transfer agent (MTA) that routes and delivers electronic mail, intended as an alternative to the widely used Sendmail MTA.

The postfix command controls the operation of the Postfix mail system: start or stop the master daemon, do a health check, and other maintenance.

Red Hat Linux Start/Stop/Restart postfix Command

# /sbin/service postfix stop
# /sbin/service postfix start
# /sbin/service postfix restart

Wednesday, November 13, 2013

HP-UX - Account is disabled - see Account Administrator

HP-UX - Account is disabled - see Account Administrator

unlock and extend the life of account
/usr/lbin/modprpw -k -l abcd
/usr/lbin/modprpw -v -l abcd

Tuesday, November 12, 2013

How to change domain name(Red Hat Linux)?



  • How to change domain name(Red Hat Linux)?
  • # dnsdomainname <name>
     or 
    # nisdomainname <name> 
  • # vi /etc/sysconfig/network
    change HOSTNAME=name
    # vi /etc/hosts
  • Monday, November 11, 2013

    Raw and Block Device

    Raw and Block Device

    Use a physical volume’s raw device file for these tasks only:
    • When preparing a physical volume for LVM using the pvcreate command. Here, you use the device file for the disk. For example, this might be /dev/rdisk/disk14. (The absence of a partition suffix indicates you are referring to the entire disk.)
    • When removing LVM information from a physical volume using the pvremove command.
    • When restoring your volume group configuration using the vgcfgrestore command.
    • When performing a consistency check on a physical volume using the pvck command.
    • When modifying the volume group identifier on a physical volume using the vgchgid command.

    For all other tasks, use the block device file. For example, when you add a physical volume to a volume group using the vgextend command, you use the disk’s block device file for the disk, such as /dev/disk/disk14. All disk device files are created automatically when a new disk is discovered. Refer to insf(1M) for more information.

    Dealing with Disk Failures Under LVM

    Dealing with Disk Failures Under LVM

     remove mirror disk from logical volume
    # lvreduce -m 0 /dev/vg03/lvol1 /dev/dsk/c2t6d0
    # vgreduce /dev/vg03 /dev/dsk/c2t6d0

    add mirror disk to logical volume
    # pvcreate /dev/rdsk/c2t9d0
    # vgextend /dev/vg03 /dev/dsk/c2t9d0
    # lvextend -m 1 /dev/vg03/lvol1 /dev/dsk/c2t9d0

    Turn on Locate LED for SAS Drive on HP-UX

    Turn on Locate LED for SAS Drive on HP-UX

    [root@pics01:/]: sasmgr get_info -D /dev/sasd0 -v -q lun=all -q lun_locate
    LUN                       LUN HW Path               Enc   Bay   Locate LED
    ===                       ===========               ===   ===   ==========
    /dev/rdsk/c2t0d0          0/4/1/0.0.0.0.0           1     1     OFF
    /dev/rdsk/c2t10d0         0/4/1/0.0.0.10.0          1     6     OFF
    /dev/rdsk/c2t1d0          0/4/1/0.0.0.1.0           1     2     OFF
    /dev/rdsk/c2t2d0          0/4/1/0.0.0.2.0           1     3     OFF
    /dev/rdsk/c2t3d0          0/4/1/0.0.0.3.0           1     4     OFF
    /dev/rdsk/c2t4d0          0/4/1/0.0.0.4.0           1     5     OFF
    /dev/rdsk/c2t7d0          0/4/1/0.0.0.7.0           1     8     OFF
    /dev/rdsk/c2t9d0          0/4/1/0.0.0.9.0           1     7     OFF

    To turn on, run the following:
    [root@pics01:/]: sasmgr set_attr -D /dev/sasd0 -q lun=/dev/rdsk/c1t3d0 -q locate_led=on
    Locate LED set to ON.
    To turn off, run the following:
    [root@pics01:/]: sasmgr set_attr -D /dev/sasd0 -q lun=/dev/rdsk/c1t3d0 -q locate_led=off
    Locate LED set to OFF.

    [root@pics01:/]: ioscan -funC disk
    Class        I  H/W Path        Driver         S/W State   H/W Type     Description
    ====================================================================================
    disk         0  0/0/2/1.0.16.0.0       sdisk          CLAIMED     DEVICE       TEAC    DV-28E-N
                                   /dev/dsk/c0t0d0   /dev/rdsk/c0t0d0
    disk        19  0/3/1/0.127.0.0.0.0.2  sdisk          CLAIMED     DEVICE       NETAPP  LUN
                                   /dev/dsk/c12t0d2   /dev/rdsk/c12t0d2
    disk        18  0/3/1/0.127.1.0.0.0.2  sdisk          CLAIMED     DEVICE       NETAPP  LUN
                                   /dev/dsk/c13t0d2   /dev/rdsk/c13t0d2
    disk         3  0/4/1/0.0.0.0.0        sdisk          CLAIMED     DEVICE       HP      DH072ABAA6
                                   /dev/dsk/c2t0d0     /dev/dsk/c2t0d0s2   /dev/rdsk/c2t0d0    /dev/rdsk/c2t0d0s2
                                   /dev/dsk/c2t0d0s1   /dev/dsk/c2t0d0s3   /dev/rdsk/c2t0d0s1  /dev/rdsk/c2t0d0s3
    disk         4  0/4/1/0.0.0.1.0        sdisk          CLAIMED     DEVICE       HP      DH072ABAA6
                                   /dev/dsk/c2t1d0   /dev/rdsk/c2t1d0
    disk         5  0/4/1/0.0.0.2.0        sdisk          CLAIMED     DEVICE       HP      DH072ABAA6
                                   /dev/dsk/c2t2d0   /dev/rdsk/c2t2d0
    disk         6  0/4/1/0.0.0.3.0        sdisk          CLAIMED     DEVICE       HP      DH072ABAA6
                                   /dev/dsk/c2t3d0   /dev/rdsk/c2t3d0
    disk         7  0/4/1/0.0.0.4.0        sdisk          CLAIMED     DEVICE       HP      EH0072FAWJA
                                   /dev/dsk/c2t4d0   /dev/rdsk/c2t4d0
    disk        10  0/4/1/0.0.0.7.0        sdisk          CLAIMED     DEVICE       HP      DH072ABAA6
                                   /dev/dsk/c2t7d0   /dev/rdsk/c2t7d0
    disk        23  0/4/1/0.0.0.9.0        sdisk          CLAIMED     DEVICE       HP      DH072BB978
                                   /dev/dsk/c2t9d0   /dev/rdsk/c2t9d0
    disk         9  0/4/1/0.0.0.10.0       sdisk          CLAIMED     DEVICE       HP      DH072ABAA6
                                   /dev/dsk/c2t10d0   /dev/rdsk/c2t10d0
    disk         1  0/4/2/0.0.0.0.0        sdisk          CLAIMED     DEVICE       HP      DH072ABAA6
                                   /dev/dsk/c1t0d0   /dev/rdsk/c1t0d0
    disk         2  0/4/2/0.0.0.1.0        sdisk          CLAIMED     DEVICE       HP      DH072ABAA6
                                   /dev/dsk/c1t1d0   /dev/rdsk/c1t1d0
    disk        20  0/6/1/0.104.0.0.0.0.2  sdisk          CLAIMED     DEVICE       NETAPP  LUN
                                   /dev/dsk/c10t0d2   /dev/rdsk/c10t0d2
    disk        21  0/6/1/0.104.1.0.0.0.2  sdisk          CLAIMED     DEVICE       NETAPP  LUN
                                   /dev/dsk/c11t0d2   /dev/rdsk/c11t0d2
    [root@pics01:/]:

    [root@pics01:/]: saslist get_info ctrl sasd
    H/W Path:  0/4/1/0              HBA DSF: /dev/sasd0
    H/W Path:  0/4/2/0              HBA DSF: /dev/sasd1
    [root@pics01:/]:

    [root@pics01:/]: saslist get_info lun sasd
    HBA device file: /dev/sasd0
    -----------------------------
    LUN dsf              Hardware Path                  SAS Address
    ------------------------------------------------------------------
    /dev/rdsk/c2t0d0     0/4/1/0.0.0.0.0                0x5000c500059c53b9
    /dev/rdsk/c2t10d0    0/4/1/0.0.0.10.0               0x5000c50000ea54a1
    /dev/rdsk/c2t1d0     0/4/1/0.0.0.1.0                0x5000c500059c0a15
    /dev/rdsk/c2t2d0     0/4/1/0.0.0.2.0                0x5000c500059c8629
    /dev/rdsk/c2t3d0     0/4/1/0.0.0.3.0                0x5000c500059c36b5
    /dev/rdsk/c2t4d0     0/4/1/0.0.0.4.0                0x5000c500332c0dd9
    /dev/rdsk/c2t7d0     0/4/1/0.0.0.7.0                0x5000c500059c6fa9
    /dev/rdsk/c2t9d0     0/4/1/0.0.0.9.0                0x5000c5000a35a331


    HBA device file: /dev/sasd1
    -----------------------------
    LUN dsf              Hardware Path                  SAS Address
    ------------------------------------------------------------------
    /dev/rdsk/c1t0d0     0/4/2/0.0.0.0.0                0x5000c500059c78e9
    /dev/rdsk/c1t1d0     0/4/2/0.0.0.1.0                0x5000c500059c98c1


    [root@pics01:/]:

    [root@pics01:/]: sasmgr get_info -D /dev/sasd0 -q phy=all

    Mon Nov 11 16:11:43 2013

    Info for PHY ID                                    : 0
    PHY Health                                         : UP
    Port SAS Address                                   : 0x500605b0005334a0
    Attached SAS Address                               : 0x5000c500059c36b5
    Current Link Rate                                  : 3 Gbps
    Max Link Rate                                      : 3 Gbps

    Info for PHY ID                                    : 1
    PHY Health                                         : UP
    Port SAS Address                                   : 0x500605b0005334a1
    Attached SAS Address                               : 0x5000c500059c8629
    Current Link Rate                                  : 3 Gbps
    Max Link Rate                                      : 3 Gbps
    .
    .

    How to recover root password in Trusted system HP-UX 11i

    How to recover root password in Trusted system HP-UX 11i
    restart machine.

    If you have a console ctrl-b, login and then use the rs command.
    Power switch only if no user can soft boot the machine.
    Interupt at the console at the 10 second prompt

    BO

    Y Interact

    hpux -is

    You will now boot single user mode.
    May need to run fsck command, if you run mount got error.
    mount /usr
    mount /var
    mount /tmp

    You may need to use the fill path of the mount command.
    TERM=vt100; export TERM
    /usr/bin/vi /tcb/files/auth/r/root

    change:
    :u_pwd=YfdfdTmswL7o/.:\
    to
    :u_pwd=:\

    null it out and save it.
    reboot
    after reboot, login as root without password.
    passwd

    Set the root password and remember it this time.

    Done.



    Unable to login as root ( Account is disabled - see Account Administrator)

    1) direct login of root via telnet is restricted to the system console via the /etc/securetty file
    2) account is disabled but the disable is overridden if login is from /dev/console.
    # /usr/lbin/modprpw -k root

    System Shutdown

    To shut down HP-UX for power-off, you can do any of the following:
    # init 0
    # shutdown -h -y now
    
    
    To shut down and reboot HP-UX:
    # reboot
    # shutdown -r -y now
    
    
    To shut down HP-UX to single-user mode:
    # init S
    # shutdown -y now
    # shutdown 0
    
    
    The -h option to the shutdown command halts the system completely but will prompt you for a message to issue users. The -y option completes the shutdown without asking you any of the questions it would normally ask. 

      How to Change Instance Type & Security Group of EC2 in AWS By David Taylor Updated April 29, 2023 EC2 stands for Elastic Compute Cloud...