Showing posts with label hp-ux. Show all posts
Showing posts with label hp-ux. Show all posts

Saturday, June 1, 2013

Unix well known port numbers

Port NumberDescription
1 TCP Port Service Multiplexer (TCPMUX)
5 Remote Job Entry (RJE)
7 ECHO
18 Message Send Protocol (MSP)
20 FTP -- Data
21 FTP -- Control
22 SSH Remote Login Protocol
23 Telnet
25 Simple Mail Transfer Protocol (SMTP)
29 MSG ICP
37 Time
42 Host Name Server (Nameserv)
43 WhoIs
49 Login Host Protocol (Login)
53 Domain Name System (DNS)
69 Trivial File Transfer Protocol (TFTP)
70 Gopher Services
79 Finger
80 HTTP
103 X.400 Standard
108 SNA Gateway Access Server
109 POP2
110 POP3
115 Simple File Transfer Protocol (SFTP)
118 SQL Services
119 Newsgroup (NNTP)
137 NetBIOS Name Service
139 NetBIOS Datagram Service
143 Interim Mail Access Protocol (IMAP)
150 NetBIOS Session Service
156 SQL Server
161 SNMP
179 Border Gateway Protocol (BGP)
190 Gateway Access Control Protocol (GACP)
194 Internet Relay Chat (IRC)
197 Directory Location Service (DLS)
389 Lightweight Directory Access Protocol (LDAP)
396 Novell Netware over IP
443 HTTPS
444 Simple Network Paging Protocol (SNPP)
445 Microsoft-DS
458 Apple QuickTime
546 DHCP Client
547 DHCP Server
563 SNEWS
569 MSN
1080 Socks

HP UX Patch level

The patch level can be found by looking at the installed bundles. The bundles can be found by running the following command:
swlist -l bundle | grep -i patch
Compare the bundles.

There can also be several patches installed that are not in a bundle. These can be found by running the following command:
/usr/contrib/bin/show_patches
It is also possible to have installed patches that are not configured. You can check for these kinds of patches with the following command:
swlist -l patch -a state

Monday, October 29, 2012

HP UX : Creating a trusted host environment using SSH




The trusted host environment as an alternative to setting up public-private SSH key pairs.
For automation or in a scripted environment in which these types of calls are necessary, the trusted host network,
though still bearing some security risks, has advantages over the public-private key pair scenario.
A trusted host network or trusted host authentication relies primarily on preconfigured files that list a combination of users and hosts that are allowed access.
There are two types of trusted-host authentication. The older (such as for OpenSSH and SSH1) and weaker uses the clear-text protocol commands (rsh, rcp, and rlogin);

checks the two files; and sets one keyword in the sshd_config file:
/etc/hosts.equiv
~/.rhosts

SSH Protocol 2 does not support this method. Instead, for a more secure trusted host network,
make the following changes in the /etc/ssh/sshd_config file (which accepts host names or IP Addresses),
and configure the shosts.equiv and/or the .shosts files:

/etc/shosts.equiv
~/.shosts

To enable a trusted-host environment in the /etc/ssh/sshd_config file for SSH Protocol 2, use:
PermitEmptyPasswords yes
AllowSHosts remoteclient.com
DenySHosts

For example, if you were on the server example.com and had configured your /etc/shosts.equiv file as follows:

+remoteclient.com fsmythe
+secureserver.net sallyh
+192.168.100.12 fsmythe
-hackers.org james

you would allow user fsmythe trusted host authentication from the remote sources remoteclient.com, 192.168.100.12, and secureserver.net and user sallyh access from secureserver.net,
denying access from user james at the remote source hackers.org. The trusted-host authentication and public-private SSH key pair authentication methods are similar and to a greater end achieve the same results.

Wednesday, December 14, 2011

HP-UX : How to create an EFI Partition on a Disk

NOTE: The DSF path and HW path. For example: 0/0/2/0.0x0.0x0 maps to /dev/rdisk/disk1
Create the system, operating system, and service partitions.

# cat /tmp/partitionfile
> 3
> EFI 500MB
> HPUX 100%
> HPSP 400MB
> EOF

# idisk -wf /tmp/partitionfile /dev/rdisk/disk1
idisk version: 1.31
********************** WARNING ***********************
If you continue you may destroy all data on this disk.
Do you wish to continue(yes/no)? yes

Create the new partition device files:

# insf -eC disk


Verify that the device files were created:

# ioscan -m lun


Initialize the EFI partition:

#efi_fsinit -d /dev/rdisk/disk1_p1


Populate the /EFI/HPUX/ directory on the new disk and verify the boot files:

# mkboot -e -l /dev/rdisk/disk1
# efi_cp -d /dev/rdisk/disk1_p1 /usr/newconfig/sbin/crashdump.efi /EFI/HPUX
# efi_cp -d /dev/rdisk/disk1_p1 /usr/newconfig/sbin/vparconfig.efi /EFI/HPUX
# efi_ls -d /dev/rdisk/disk1_p1 /EFI/HPUX

Friday, October 28, 2011

du & bdf or df output differs

it is important to explain that the results for bdf and du -sk are going to be different. We cannot expect they will match.

Obviously there is a difference in how du and bdf behave.
This may occur if we touch open files.


"du" shows output in a positive view: it shows the number of currently allocated blocks and counts the blocks you've just deleted as free.
"bdf" has a more negative perspective: it shows the free disk space available.


The difference is here: if a still-active process has allocated blocks (such as
for a logfile that you've just deleted), "bdf" counts these as still occupied.
This won't change until the process closes the file ("deallocates the blocks")
as it usually happens when the process terminates.

If you still want to know which process holds space, this tool can be helpful. Important, this is an open source tool and it is not supported by Hewlett Packard.

Lsof Examples

Below you will find a set of examples using the lsof tool.

Examples
To list all open files, use:

# lsof
To list all open Internet, x.25 (HP-UX), and UNIX domain files, use:

# lsof -i -U
To list all open IPv4 network files in use by the process whose PID is 1234, use:

# lsof -i 4 -a -p 1234
Presuming the UNIX dialect supports IPv6, to list only open IPv6 network files, use:

# lsof -i 6
To list all processes using a particular network port, use:

# lsof -i :


In our case, this will be the best options:

When you need to dismount file systems on an HP-UX based server, you frequently find users 'on' a particular disk or logical volume resulting in 'device busy' errors. You can identify which processes have open files on a given device (instead of using intuition and frantic 'phone calls!) by using the fuser(1M) (10.20, 11.x) command.

fuser will list the process ids and usernames of processes that have a given file open and can even be used to automatically kill the identified processes. For example,

# fuser -u /mydir # All processes with
# /mydir open

# fuser -ku /dev/dsk/c0t6d0 # Kill all processes
# with files open on
# certain disk

Please see the man pages for additional options.

There is also a public domain tool called lsof that can be pulled from the internet and built on HP-UX. It shows all the files open by all the processes on the system, so use it in conjunction with grep if you are looking for a particular directory on a particular disk. For example,

# lsof | grep /mydisk

will show all processes with open files on the /mydisk file system.

To get lsof proceed as follows:

Anon ftp to vic.cc.purdue.edu
cd pub/tools/unix/lsof
Get lsof.tar.Z
uncompress lsof.tar.Z
tar -xvf lsof.tar
Read README.FIRST for instructions on how to build lsof.


If you cannot access to get the lsof script, it is attached anyway

The main situation here is: It is a know and expected situation that bdf and du will display different information.

Wednesday, October 5, 2011

HP UNIX AUTH_MAXTRIES

$ su - username
Password:
Access is denied by the AUTH_MAXTRIES option in security(4).
su: Sorry
$

#userdbset -d -u username auth_failures

Friday, May 20, 2011

LSOF for HP-UX

LSOF for HP-UX can be downloaded from -

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.84/

Tuesday, February 22, 2011

Powerpath issue on HP Unix

Recent Issue:

Server was ignited earlier using OS image of one of the similar hardware model.
We had some issues on performance and found Powerpath issue. Removed the powerpath and installed it again, It required kernel rebuild and started system reboot. But system was not able to boot. Below is the error faced.


ERROR: phy_unit_init: Could not open file: /tmp/ign_configure/hw.info: No
such file or directory (errno = 2)
ERROR: read_hw_info failed

The configuration process has incurred an error, would you like
to push a shell for debugging purposes? (y/[n]):

Solution:
When powerpath software was uninstalled, it restored the pre-ignited image script to the startup files. This caused the server boot to fail checking for ignited configuration files in /tmp directory.

The backup files are saved during the post-installation when the server is ignited. In general the files should not be altered but PP package removal seems to behave differently.
The start scripts which were sourcing for ignited files were removed, rescanned the hardware, and the server was fully tested without PowerPath 5.1 installed.

After validation, we installed Power Path 5.1

learn:/sbin/rc2.d>swlist | grep -i emc
EMCpower HP.5.1.SP2_b113 PowerPath

After installation, the power path does not work as expected and behave the same way as the earlier version

learn:/sbin/rc2.d>sh S999emcp start
Unexpected error occured.
emcpmgr: internal library error (0xebad002)
Error: unable to update device configuration file(s)
No migrations found.

learn:/sbin/rc2.d>powermt display dev=all
Initialization error.

After numbers of attempts with remove/install PP, We finally found the main problem. It is actually a bug with PP and from versions like 4.x it is still there. What happened was that the entry in the /etc/inittab file for PP initialization which is running BEFORE the /sbin/init.d/emcp script and loads kernel modules to the host was missing on the host. /etc/inittab should have been updated during installation, but because that bug, it was not and PP kernel modules could not load at boot.

The entry below has been added to the /etc/inittab file and after reboot PPworked fine.
pwr::sysinit:/sbin/emcpstartup /dev/console 2>&1 # PowerPath

We should have noticed that earlier, but found it at the end.

You can find the solution on Powerlink article emc93018.

Thursday, December 23, 2010

After Ignite, problem with HP LVM

Recently we ignited the HP-UX server, later we had issues in LVM.
We were not able to delete the VGs when we wished to re-layout the VG and restore the data from Backup.

Beloa are the one finally helped.

vgchange -a n /dev/vg
vgexport /dev/vg

in script -
for vg in $(strings /etc/lvmtab | grep vg)
do
echo vgchange -a n $vg
echo vgexport $vg
done


Some useful scripts -

# printf "%-18s | %-17s | %-17s\n" "PV" "VGID" "PVID"; \ for pv in `ls /dev/rdsk/*` do xd -An -j8200 -N16 $pv > /dev/null 2>&1 if [[ $? -eq 0 ]]; then echo "$pv \c" xd -An -j8200 -N16 -tx $pv 2> /dev/null fi done \ | awk '$0 ~ /dev/ {printf "%-18s | %8s %8s | %8s %8s\n", $1, $4, $5, $2, $3}' \ | sort -k 2,5

Wednesday, December 22, 2010

HP UNIX - To Find the Alternate Links

for pv in $(ls /dev/rdsk/*)
do
echo $pv
xd -An -j8200 -N16 -tx $pv 2> /dev/null
done > /tmp/output

Saturday, September 18, 2010

HP UNIX TIPS

http://www.hpuxtips.es/?q=node/12

Thursday, June 3, 2010

HP-UX : Processors and Core

Number of Processors:
#top
#ioscan -Cprocessor

To find out the core:
#echo "selclass qualifier cpu;info;wait;il" | cstm

Wednesday, May 26, 2010

HP-UX: Booting from an alternate kernel

HP-UX: Booting from an alternate kernel

Press a key, while PDC is waiting for the 10 seconds manual overide.

Autosearch for boot path enabled

To override, press any key with 10 seconds.


Boot from primary boot path (Y or N)?> N
Boot from alternate boot path (Y or N)?> N
Enter boot path, comman, or ?>

console>boot
Interact with IPL (Y or N)?>Y

Booting...
Boot IO Dependent Code (IODC) revision 4

Hard Booted

ISL Revision A.00.38 Oct 26, 1994

ISL>hpux boot disk()/stand/vmunix.prev

Wednesday, April 28, 2010

Account is disabled – see Account Administrator

This time is a tip to enable a user account if your system uses password aging or the user was locked out due to the unsuccessful login attempts.

login: user
Password:
Account is disabled – see Account Administrator

To enable a locked or disabled HP-UX account, run the command:

/usr/lbin/modprpw -l -k