Thursday 31 October 2013

AIX,Linux,Solaris & HPUx Vendor Service Contact Details

Unix -Vendor  Service Contact Details:

Sometimes its very frustrating  when you need to call your vendor support for priority issues and you are not able to get the contact information on that moment.

As unix admin , one day other you encounter this kind of situation. Today I got something in mind to share the few prominent Unix flavored vendor support contact details,support web site links and links to system snaps and performance snap.

The most competent Unix flavors currently in the market are 

1) AIX
2) Linux
3) Solaris
4) HP-Ux

1) AIX (Advanced Interactive eXecutive):

AIX (Advanced Interactive eXecutive) is a series of proprietary Unix operating systems developed and sold by IBM for several of its computer platforms.

AIX now supports or has supported a wide variety of hardware platforms, including the IBM RS/6000 series and later POWER and PowerPC-based systems, IBM System i, System/370 mainframes, PS/2 personal computers, and the Apple Network Server. AIX is based on UNIX System V with 4.3BSD-compatible extensions.

IBM-AIX
Operating System
AIX (Advanced Interactive eXecutive)
Vendor
IBM
Supported Version
6.1v & 7.1v
Home Page
Support Web-link
Contact Number
1800-IBM-SERV (1800-426-7378)
Mailing Lists
IBM Electronic Support Community
S/W Download
User Forums
Documentation
AIX Blogs

AIX -Support S/W Links
AIX Operating System Snap
# snap –r Removes the previous information.
# snap –g   This command gathers ODM, error report, trace file, user environment, paging space, amount of physical memory, security user information and device information.
# snap –a  This command gathers all system information.
# snap –c   Creates a compressed pax image.
# snap –D  It gathers dump and /unix information.
# snap –e  This command gathers HACMP specific information from all nodes.
# snap -d new_directory -ac   Includes ALL information.
Creates the snap output file in a directory specified by "new_directory". This directory should not exist as snap will create it. Without the -d flag the snap output is saved to /tmp/ibmsupt.

Any point of time you can combine one or more options based on your requirement.

#cd /tmp/ibmsupt;mv snap.pax.Z CASE_NUMBER.snap.pax.Z

ftp testcase.software.ibm.com
login: ftp
>cd /toibm/aix
>bin
>hash
>put CASE_NUMBER.snap.pax.Z
PerfPMR
GPFS SNAP
/usr/lpp/mmfs/bin/gpfs.snap -w $nodename
(output will be in /tmp/gpfs.snapOut)
Micro Code Updates

2) Linux ( Redhat)

Linux is a Unix-like and POSIX-compliant computer operating system assembled under the model of free and open source software development and distribution.Linux operating system kernel initially developed by "Linus Torvalds".
There are so many linux vendors are in the market. Right now we are going to deal with Redhat which is the most widely used out of all.

Linux (Redhat)
Operating System
Linux
Vendor
Red Hat, Inc
Supported Version
RHEL6.1
Home Page
Support Case
https://access.redhat.com/support/cases/new                                                                                          
Contact Number
1 888-GO-REDHAT (1 888-467-3342)   ; Also refer other countries contacts with this link https://access.redhat.com/site/support/contact/technicalSupport/
Redhat Community
S/W Download link
User Forums
Documentation

3) Solaris:

 Solaris is a Unix operating system originally developed by Sun Microsystems. It superseded their earlier SunOS in 1993. Oracle Solaris, as it is now known, has been owned by Oracle Corporation since Oracle's acquisition of Sun in January 2010.
Solaris is known for its scalability, especially on SPARC systems, and for originating many innovative features such as DTrace, ZFS and Time Slider.Solaris supports SPARC-based and x86-based workstations and servers from Oracle and other vendors, with efforts underway to port to additional platforms. Solaris is registered as compliant with the Single Unix Specification.

Solaris
Operating System
Solaris
Vendor
Oracle Co
Supported Version
9,10 & 11
Home Page
http://www.oracle.com/us/products/servers-storage/solaris/overview/index.html
Contact Number
1-800-633-0925
Support Case
S/W Download link
Blog
Documentation
Case Upload

4) HP-Ux:

HP-UX (Hewlett-Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on UNIX System V (initially System III) and first released in 1984. Recent versions support the HP 9000 series of computer systems, based on the PA-RISC processor architecture, and HP Integrity systems, based on Intel's Itanium architecture.

HP UX
Operating System
HP-Ux
Vendor
Hewlett-Packard
Supported Version
HP-UX 11i
Home Page
Support Case
http://www8.hp.com/us/en/support.html
Contact Number
1 800-277-8988
S/W Download link
Blog
Documentation

Thursday 24 October 2013

All-IN-ONE: Linux User Administration

Linux User Administration:


As a Linux Administrator its very important job to monitor and administering users on Linux server.Security plays vital role in any organization , so user administration is very critical."The similarities of sysadmins and drug dealers: both measure stuff in Ks, and both have users." (Old, tired computer joke.)

Going forward i am  going to explain different types user accounts,how to create new user accounts, how to modify the properties of those accounts, and how to remove the accounts.There are some differences in-terms of commands used in different Linux flavors but these commands will work mostly.

What is shell account ?

A Shell account is just like a bank account  which is created on Linux  server,which gives access to a shell via a command line  interface protocol such as telnet or ssh.There is more than to user account than just a name.An account is all the files, resources, and information belonging to one user.

Before moving to learn about types of shell accounts we need to know few terms .

Whenever you are trying to add a shell account (user) you add an entry to "/etc/passwd" file.This is an essential file  used during the login. This file consists of seven colon-separated fields(:), specified all on one line.

Eg:
surya:x:501:105:Surya_Unix_Admin:/home/surya:/bin/bash
ram:!:202:100:Ram_App_User:/home/ram:/bin/bash


The fields are: user login name(shell account), password, UID, GID, comment (gecos) field, user's home directory & user's default shell

1)  Username: It is used when user logs in. It should be between 1 and 32 characters in  length.Each name  must be unique

2)  Password: An 'x' character indicates that encrypted password is stored in /etc/shadow file.

3)  User ID (UID): Each user must be assigned a user ID (UID). UID 0 (zero) is reserved for root and UIDs. 1-99 are reserved for other predefined accounts. Further UID 100-999 are reserved by system for  administrative and system accounts/groups.
   
4)  Group ID (GID): The primary group ID (stored in /etc/group file)

5)  User ID Info(Gecos): The comment field. It allow you to add extra information about the users   such as  user's  full name, phone number etc. This  field use by finger command.
   
6)  Home directory: The absolute path to the directory the user will be in when they log in. If this directory does not exists then users directory  becomes /.
   
7) Command/shell: The absolute path of a command or shell (/bin/bash). Typically, this is a shell. Please   note that it does not have to be a shell.

Note: Your encrypted password is not stored in /etc/passwd file. It is stored in /etc/shadow file.

Type of Linux user accounts:


There are three basic types of user accounts.

1) Administrative (root) Account

2) Regular Account

3) Service Account

Administrative Account:  

Its root ,we often see people calling it as "super user" which is created automatically  when you install Linux operating system.

A special kind of user account which holds all kind’s of permissions to do any alteration to a programs or services of Linux. Especially this kind of  user account is used for  system administration. He can control and limit the access of other User’s. As  all the powers is vested for Root User, care has to be taken before performing each and every modifications, if anything goes wrong, no option left other than crash of  Kernel. It is so sensitive with unlimited accessibility.Take care while logged in as Root :-).

Regular Account: 

Regular user accounts have privileges to perform standard tasks on a Linux computer such as running word processors, databases, and Web browsers.They can store files in their own home directories. Since regular users do not normally have administrative privileges, they cannot accidentally delete critical operating system configuration files.

Service Account:

Services such as Apache, Squid, mail, games, and printing have their own individual service accounts. These accounts exist to allow each of these services to interact with your computer.


Exploring UID:

Every Users got their own identity and authenticity. When someone say Identity of the User, UID (User identifier) comes into picture.  UID  is a unique identity, simply a number given to the user.Valid UID ranges are from 0 to 65534.

Every kind of User type as discussed above are given a particular range of UID’s.

Root User got the UID ‘0‘ . {As root user is prime and supreme authoritative, so he got the UID ” 0 “, This can be altered in the configuration file, which we come across later}

UID for System User lies with in the range of 1 to 499. {Don’t come to a conclusion that Linux OS can only provide 500 System Users. It’s just a default range provided by the OS, it can be altered and can add system users greater than 500 but less than a saturation value which depends on a type Linux OS}.

UID for Normal User lies with in the range of > 500 <6000.
UID for Network User lies with in the range of  >6000.

User Administration-Live:

1) Creating User Account:  

   "useradd" : This command is used to create a new user with default values.
 
$useradd   {username}

   where the options can be,

  -U = User id
  -g = group ID (primary)
  -G = group ID (secondary)
  -c = comment
  -d = directory
  -s  = shell
  -f  = inactive days
  -e = expire date (YYYY MM DD)
 
    # useradd surya

   # passwd surya
   Changing password for user surya.
   New UNIX password:
   Retype new UNIX password:
   passwd: all authentication tokens updated successfully.

# grep surya /etc/passwd
surya:x:500:500::/home/surya:/bin/bash

# grep surya /etc/group
surya:x:500:
[Note: default useradd command created surya as username and group

To view the default options give the following command with the option-D.
$ useradd -D
GROUP=1001
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/sh
SKEL=/etc/skel
CREATE_MAIL_SPOOL=no

  • GROUP: This is the only option which will not be taken as default. Because if you don’t specify -n option a group with same name as the user will be created and the user will be added to that group. To avoid that and to make the user as the member of the default group you need to give the option -n. 
  • HOME: This is the default path prefix for the home directory. Now the home directory will be created as /home/USERNAME.
  • INACTIVE: -1 by default disables the feature of disabling the account once the user password has expired. To change this behavior you need to give a positive number which means if the password gets expired after the given number of days the user account will be disabled.
  • EXPIRE: The date on which the user account will be disabled.
  • SHELL: Users login shell.
  • SKEL: Contents of the skel directory will be copied to the users home directory.
  • CREATE_MAIL_SPOOL: According to the value creates or does not create the mail spool.

2) Modify user accounts ( UserName/Lock/Un-Lock):

usermod : This command is used to modify the user accounts. Only the administrator can use this command. It's syntax is,
$ usermod   {username} 

where the options can be,    

-l = to change the user name
-L = to lock the user account
-U = to unlock the user account

3) Changing Password of a User:

passwd:This command is used to generate the passwords for users account.
$ passwd < user-name>
To disable a password,
$ passwd -d  {username}

4) Remove/Delete  a User:

userdel : This command is used to delete a user account.
$userdel    {user-name}

This will remove the user. But if you want to remove their home folder and all their files.
$userdel -r   {user-name}

Miscellaneous Commands:

5) Change user password expiry information:

chage: This command is used to change the password expiry information.
$ chage {user-name}

6) change the shell of a User:

chsh: Changes a user's login shell.

Valid shells are defined in the usw stanza of the /etc/security/login.cfg file. The default list of valid shells is: /usr/bin/ksh, /usr/bin/sh, /usr/bin/bsh, /usr/bin/csh but your system manager may have defined more.

To change the shell to /usr/bin/ksh for ram, type:
 #chsh ram /usr/bin/ksh

7) Editing the default options used by useradd:

The following example shows how to change the default shell from /bin/bash to /bin/ksh during user creation.

Syntax: #useradd -D --shell={shell name}

# useradd -D
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
[Note: The default shell is /bin/bash]

# useradd -D -s /bin/ksh

# useradd -D
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/ksh
SKEL=/etc/skel
[Note: Now the default shell changed to /bin/ksh]

# useradd ram

# grep ram /etc/passwd
ram:x:512:512::/home/ram:/bin/ksh
[Note: New users are getting created with /bin/ksh]

# useradd -D -s /bin/bash
[Note: Set it back to /bin/bash, as the above is only for testing purpose]

8)  Linux adduser Command – Create Users Interactively:

These are the friendlier tools to the low level useradd. By default it chooses the Debian policy format for UID and GID. A very simple way of creating user in the command line interactively is using adduser command.

Syntax: # adduser {username}

# adduser pinky

Adding user `pinky' ...
Adding new group `pinky' (1009) ...
Adding new user `pinky' (1009) with group `pinky' ...
Creating home directory `/home/pinky' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for pinky
Enter the new value, or press ENTER for the default
    Full Name []: Peter Parker
    Room Number []:
    Work Phone []:
    Home Phone []:
    Other []:
    Is the information correct? [y/N] y

9) Linux newusers Command — Creating bulk users:

Sometimes you may want to to create multiple users at the same time.
Any method for bulk user creation can be very tedious and time consuming. Fortunately, Linux offers a way to upload users using newusers command. This can also be executed in batch mode as it cannot ask any input.

Syntax: # newusers   {filename}


This file format is same as the password file.
loginname:password:uid:gid:comment:home_dir:shell

#cat db-tema-users.txt
sony:HbZ600a9:1008:1000:Sony DBA:/home/sony:/bin/bash
navs:1enq733N:1009:1000:Navs DBA:/home/navs:/bin/csh
rohan:1y51Jr8K:1010:1000:Rohan DBA:/home/rohan:/bin/ksh

Create DBA team user ids at oneshot

# newusers db-tema-users.txt

I hope these are helpful to you,see you again with another article.

Friday 18 October 2013

Backup and Restore the Virtual I/O Server

How to backup and restore the Virtual I/O Server

This document describes different methods to backup and restore the Virtual I/O Server.


Backing up the Virtual I/O Server

There are 4 different ways to backup/restore the Virtual I/O Server as illustrated in the following table.

Backup method
Restore method
To tape
From bootable tape
To DVD
From bootable DVD
To remote file system
From HMC using the NIMoL facility and installios
To remote file system
From an AIX NIM server

Backing up to a tape or DVD-RAM

To backup the Virtual I/O Server to a tape or a DVD-RAM, the following steps must be performed

  1. check the status and the name of the tape/DVD drive
lsdev | grep rmt (for tape)
lsdev | grep cd (for DVD)

  1. if it is Available, backup the Virtual I/O Server with the following command
backupios –tape rmt#
backupios –cd cd#

If the Virtual I/O Server backup image does not fit on one DVD, then the backupios command provides instructions for disk replacement and removal until all the volumes have been created. This command creates one or more bootable DVDs or tapes that you can use to restore the Virtual I/O Server.

Backing up the Virtual I/O Server to a remote file system by creating a nim_resources.tar file

The nim_resources.tar file contains all the necessary resources to restore the Virtual I/O Server,including the mksysb image, the bosinst.data file, the network boot image, and SPOT resource.

The NFS export should allow root access to the Virtual I/O Server, otherwise the backup will fail with permission errors.

To backup the Virtual I/O Server to a filesystem, the following steps must be performed

  1. Create a mount directory where the backup file will be written
mkdir /backup_dir
  1. Mount the exported remote directory on the directory created in step 1.
mount server:/exported_dir /backup_dir
  1. Backup the Virtual I/O Server with the following command
backupios –file /backup_dir

The above command creates a nim_resources.tar file that you can use to restore the Virtual I/O Server from the HMC.

Note:The ability to run the installios command from the NIM server against the nim_resources.tar file is enabled with APAR IY85192.

The backupios command empties the target_disk_data section of bosinst.data and sets RECOVER_DEVICES=Default. This allows the mksysb file generated by the command to be cloned to another logical partition. If you plan to use the nim_resources.tar image to install to a specific disk, then you need to repopulate the target_disk_data section of bosinst.data and replace this file in the nim_resources.tar. All other parts of the nim_resources.tar image must remain unchanged.

Procedure to modify the target_disk_data in the bosinst.data:

  1. Extract from the nim_resources.tar the bosinst.data
tar -xvf nim_resources.tar ./bosinst.data
  1. The following is an example of the target_disk_data stanza of the bosinst.data generated by backupios.
target_disk_data:
LOCATION =
SIZE_MB =
HDISKNAME =
  1. Fill the value of HDISKNAME with the name of the disk to which you want to restore to
  2. Put back the modified bosinst.data in the nim_resources.tar image
tar -uvf nim_resources.tar ./bosinst.data

If you don't remember on which disk your Virtual I/O Server was previously installed, you can also view the original bosinst.data and look at the target_disk_data stanza.

Use the following steps

  1. extract from the nim_resources.tar the bosinst.data
tar -xvf nim_resources.tar ./bosinst.data
  1. extract the mksysb from the nim_resources.tar
tar -xvf nim_resources.tar ./5300-00_mksysb
  1. extract the original bosinst.data
restore -xvf ./5300-00_mksysb ./var/adm/ras/bosinst.data
  1. view the original target_disk_data
grep -p target_disk_data ./var/adm/ras/bosinst.data
           The above command displays something like the following:

target_disk_data:                                    
PVID = 00c5951e63449cd9                          
PHYSICAL_LOCATION = U7879.001.DQDXYTF-P1-T14-L4-L0
CONNECTION = scsi1//5,0                          
LOCATION = 0A-08-00-5,0                          
SIZE_MB = 140000                                 
HDISKNAME = hdisk0  
  1. replace ONLY the target_disk_data stanza in the ./bosinst_data with the original one                            
  2. add the modified file to the nim_resources.tar
tar -uvf nim_resources.tar ./bosinst.data

Backing up the Virtual I/O Server to a remote file system by creating a mksysb image

You could also restore the Virtual I/O Server from a NIM server. One of the ways to restore from a NIM server is from the mksysb image of the Virtual I/O Server. If you plan to restore the Virtual I/O Server from a NIM server from a mksysb image, verify that the NIM server is at the latest release of AIX.

To backup the Virtual I/O Server to a filesystem the following steps must be performed

  1. Create a mount directory where the backup file will be written
mkdir /backup_dir
  1. Mount the exported remote directory on the just created directory
mount NIM_server:/exported_dir /backup_dir
  1. Backup the Virtual I/O Server with the following command
backupios –file /backup_dir/filename.mksysb -mksysb

Restoring the Virtual I/O Server

As there are 4 different ways to backup the Virtual I/O Server, so there are 4 ways to restore it.

Restoring from a tape or DVD

To restore the Virtual I/O Server from tape or DVD, follow these steps:

  1. specify the Virtual I/O Server partition to boot from the tape or DVD by using the bootlist command or by altering the bootlist in SMS menu.
  2. insert the tape/DVD into the drive.
  3. from the SMS menu, select to install from the tape/DVD drive.
  4. follow the installation steps according to the system prompts.

Restoring the Virtual I/O Server from a remote file system using a nim_resources.tar file

To restore the Virtual I/O Server from a nim_resources.tar image in a file system, perform the following steps:

  1. run the installios command without any flag from the HMC command line.
a)      Select the Managed System where you want to restore your Virtual I/O Server from the objects of type "managed system" found by installios command.
b)      Select the VIOS Partition where you want to restore your system from the objects of type "virtual I/O server partition" found
c)      Select the Profile from the objects of type "profile" found.
d)     Enter the source of the installation images [/dev/cdrom]: server:/exported_dir
e)      Enter the client's intended IP address: <IP address of the VIOS>
f)       Enter the client's intended subnet mask: <subnet of the VIOS>
g)      Enter the client's gateway: <default gateway of the VIOS>
h)      Enter the client's speed [100]: <network speed>
i)        Enter the client's duplex [full]: <network duplex>
j)        Would you like to configure the client's network after the installation [yes]/no?
k)      Select the Ethernet Adapter used for the installation from the objects of type "ethernet adapters" found.

  1. when the restoration is finished, open a virtual terminal connection (for example, using telnet) to the Virtual I/O Server that you restored. Some additional user input might be required.

Note: The ability to run the installios command from the NIM server against the nim_resources.tar file is enabled with APAR IY85192.

Restoring the Virtual I/O Server from a remote file system using a mksysb image

To restore the Virtual I/O Server from a mksysb image in a file system using NIM, complete the following tasks:

  1. define the mksysb file as a NIM object, by running the nim command.
nim -o define -t mksysb -a server=master –a location=/export/ios_backup/filename.mksysb objectname
objectname is the name by which NIM registers and recognizes the mksysb file.

  1. define a SPOT resource for the mksysb file by running the nim command.
nim -o define -t spot -a server=master -a location=/export/ios_backup/
SPOT -a source=objectname SPOTname
SPOTname is the name of the SPOT resource for the mksysb file.

  1. install the Virtual I/O Server from the mksysb file using the smit command.
smit nim_bosinst
The following entry fields must be filled:
“Installation type” => mksysb
“Mksysb” =>  the objectname chosen in step1
“Spot” => the SPOTname chosen in step2

  1. start the Virtual I/O Server logical partition.
a)      On the HMC, right-click the partition to open the menu.
b)      Click Activate. The Activate Partition menu opens with a selection of partition profiles. Be sure the correct profile is highlighted.
c)      Select the Open a terminal window or console session check box to open a virtual terminal (vterm) window.
d)     Click (Advanced...) to open the advanced options menu.
e)      For the Boot mode, select SMS.
f)       Click OK to close the advanced options menu.
g)      Click OK. A vterm window opens for the partition.
h)      In the vterm window, select Setup Remote IPL (Initial Program Load).
i)        Select the network adapter that will be used for the installation.
j)        Select IP Parameters.
k)      Enter the client IP address, server IP address, and gateway IP address. Optionally, you can enter the subnet mask. After you have entered these values, press Esc to return to the Network Parameters menu.
l)        Select Ping Test to ensure that the network parameters are properly configured. Press Esc twice to return to the Main Menu.
m)    From the Main Menu, select Boot Options.
n)      Select Install/Boot Device.
o)      Select Network.
p)      Select the network adapter whose remote IPL settings you previously configured.
q)      When prompted for Normal or Service mode, select Normal.
r)       When asked if you want to exit, select Yes.

Integrated Virtualization Manager (IVM) Consideration


If your Virtual I/O Server is managed by the IVM, prior to backup of your system, you need to backup your partition profile data for the management partition and its clients as IVM is integrated with Virtual I/O Server, but the LPARs profile is not saved with the backupios command.

There are two ways to perform this backup:

From the IVM Web Interface

1)      From the Service Management menu, click Backup/Restore
2)      Select the Partition Configuration Backup/Restore tab
3)      Click Generate a backup

From the Virtual I/O Server CLI

1)      Run the following command
bkprofdata -o backup

Both these ways generate a file named profile.bak with the information about the LPARs configuration. While using the Web Interface, the default path for the file is /home/padmin. But if you perform the backup from CLI, the default path will be /var/adm/lpm. This path can be changed using the –l flag. Only ONE file can be present on the system, so each time the bkprofdata is issued or the Generate a Backup button is pressed, the file is overwritten.

To restore the LPARs profile you can use either the GUI or the CLI

From the IVM Web Interface

1)      From the Service Management menu, click Backup/Restore
2)      Select the Partition Configuration Backup/Restore tab
3)      Click Restore Partition Configuration

From the Virtual I/O Server CLI

1)      Run the following command
rstprofdata –l 1 –f /home/padmin/profile.bak

It is not possible to restore a single partition profile. In order to restore LPARs profile, none of the LPARs profile included in the profile.bak must be defined in the IVM.

Troubleshooting

Error during information gathering

In the case where after you specify the System Managed and the profile,the HMC is not able to find a network adapter:
  1. Check if the profile has a physical network adapter assigned
  2. Check if there is an hardware conflict with other running partition
  3. Check if the status of the LPAR is not correct (must be Not Activated)

Error during NIMOL initialization

  1. nimol_config ERROR: error from command /bin/mount < remoteNFS> /mnt/nimol
mount:< remoteNFS>  failed, reason given by server: Permission denied
probably the remote FS is not correctly exported.
  1. nimol_config ERROR: Cannot find the resource SPOT in /mnt/nimol.
probably you have specified a NFS which doesn’t contain a valid nim_resources.tar or the nim_resources.tar is a valid file but it doesn’t have valid permission for “others”

Error during lpar_netboot

In the case where the LPAR fails to power on
  1. Check if there is an hardware conflict with other running partition
  2. Check if the status of the LPAR is not correct (must be Not Activated)
In the case of Bootp failure
If the NIMOL initialization was successful
  1. Check if there is a valid route between the HMC and the LPAR
  2. Check that you have insert valid information during the initial phase

Error during BOS install phase

Probably there is a problem with the disk used for the installation

  1. Open a Vterm and check if the system is asking to select a different disk
  2. power off the LPAR, modify the profile to use another storage unit and restart installation