Users and Groups: Files Related To User/group
Users and Groups: Files Related To User/group
Starting from HP-UX 11i v3, user and group names can be 255 chars long
# useradd username
2. To create an user with the specific uid, primary group, secondary groups, home directory, shell, comment and also
creates the home directory if it doesn’t exist, also allows the uid to be non-unique:
3. To list the defaults for primary group, base directory, inactivity timeout and skeleton directory:
# useradd –D
# useradd –D –g dba
# userdel user
Faruq
9. To force a password change at next login:
12. To create a group called dba and add the respective entries to /etc/group:
# groupadd dba
# groupdel dba
16. To delete the group only if it’s not the primary group for any user:
# groupdel –s dba
17. To list the failed logins (to display the contents of /var/adm/btmp):
# lastb
18. To list the successful logins (to display the contents of /var/adm/wtmp)
# last
19. To list the currently logged in users (to display the contents of /etc/utmp)
# who –u
20. To create the password shadow file and to move the encrypted password from /etc/passwd to /etc/shadow:
# pwconv
# pwck
22. To copy the encrypted passwd and aging information from /etc/shadow to /etc/passwd and then delete the
/etc/shadow file:
# pwunconv
Faruq
Device file naming convention:
In HP-UX uses the device file naming convention looks like as follows:
c#t#d#
Use ioscan command to get information about your device under HP-UX. A block device file is always in /dev/dsk and
a character device file in /dev/rdsk directory.
Cluster commands:
Status and startup
# cmviewcl –v
This will tell you the detailed status of the cluster, nodes, packages and services. For simple cluster status you can
use cmviewcl also.
# cmruncl
This command will help/force nodes to form a cluster and start all enabled packages in that cluster.
Halting a cluster:
# cmhaltcl
This command will halt ServiceGuard operations on all nodes which are currently running in the cluster. If any
packages are running, the cluster will not be halted.
# cmhaltcl –f
This will force the packages to halt and after that it halts Service Guard operations on all nodes which are currently
running in the cluster
Starting a node:
This command will start the specified node to join an already running cluster.
Faruq
Halting a node:
This command will halt ServiceGuard operations on the specified node. If any packages are running on that node, the
node will not be halted.
Force the node to halt even if there are packages or group members running on it
Running a package
This will run the package on the current node or on the node specified. Logs will be written in
/etc/cmcluster/<SID>/<control_script>.log.
Halting a package:
This will halt the package, Logs will be written in /etc/cmcluster/<packag name>/<control_script>.log.
After a package has failed on one node, that node is disabled. This means the package will not be able to run on that
node. The following command will enable the package to run on the specified node.
This will command will disable the package to run on the specified node.
There are the OS MC ServiceGurard Components, and the Application Packages. Eight Daemons are associated
with MC/ServiceGuard.
Faruq
/usr/lbin/cmtaped---ServiceGuard Shared Tape Daemon
Daemon details:-
cmclconfd -- gathers cluster info ie network and vol grp info started in /etc/inetd.conf
cmcld -- determines cluster membership. Package Mgr, Cluster Mgr, and Network Mgr run as parts of cmcld.
Information about the starting and halting of each package is found in the package’s control script log. This log
provides the history of the
You can also find in /var/adm/syslog/syslog.log which indicate what has occurred and whether or not the package has
halted or started.
1. cmviewcl –v (This will display status packages and nodes defined to cluster. Verify
if node name not specified, command will be executed on whichever node it is issued
from)
switching. This can be issued on either node. It will automatically start pkg on it’s
Faruq
5. cmrunpkg –n <nodename> -v <pkgname> (starts specified pkg on specified node. Can
1. cmhaltnode –f –v <nodename> (halts clustering on node specified, and fails over any
Run both the packages to single node (other server is shutdown completely)
2. HP-UX Startup - Included ISL, SSL (hpux), kernel (/stand/vmunix), swapper, init and /etc/inittab
Faruq
Kernel then loads the device drivers and starts the process "swapper"
Swapper process (PID = 0) then intiates a shell process to execute commands from /sbin/pre_init_rc
Finally kernel loads the system's first process called "init". Hence init pid is always 1.
The init process processes the /etc/inittab file and runs the startup scripts to start other daemons and
processes based on the default run level set. This will take the system to the default run level and from now
5. To display the files in the /stand directory (mostly used to find the alternate kernel file name) :
Boot disk contains a boot area and a root partition plus swap space and other file systems.
f. A file named AUTO - Contains the hpux utility name and any arguments to be passed onto hpux.
Faruq
To list the contents of the boot area:
# lifls -l /dev/dsk/c0t0d0
# setboot
# mkboot
# rmboot
s - Single User Mode. Only one physical console can be used. Only the root file system is mounted. Only the
processes (daemons) those having keyword sysinit in the /etc/inittab are started and any other daemon started by the
kernel.
S - It is functionally same as ‘s’ with the exception that the current terminal will be considered as console (virtual).
1 - It is above run level ‘s’. The system is dedicated to one user but all the file systems are mounted, with a process
known as ‘syncer’ running.
3 - Functionally same as “2”, with Network daemons, NFS, Web-base administration, graphical presentation
managers running.
4 - Currently not available. You can customize this as per your environment.
5 - Currently not available. You can customize this as per your environment.
6 - Currently not available. You can customize this as per your environment.
# init 3
# who -r
# Shutdown -h -y 0
Note: You can use "reboot" command if you're running in a single user mode. It normally kills all the daemons instead
of graceful terminating them. So its not recommended in multi-user mode.
Faruq
3. To shutdown a system with no interactive response after 60 seconds:
# Shutdown -h -y 60
# Shutdown -r -h 0
5. How to view the shutdown and reboot times for the system :
# cat /etc/shutdown.log
6. How to allow an user called sinto from a remote machine (workstation1) to shutdown the system server1:
workstation sinto
System Information
1. To view OS Version:
# uname –r
Faruq
Commands to modify system information :
1. To set hostname, ip addres , date/time, dns/nis server details, default gateway after the OS installation :
This command will run automatically after the OS installation.
# set_parms initial
# set_parms date_time
Networking
Configuration Files :
Edit the necessary lines. After that you will need to restart the services as follows.
#cd /sbin/init.d
#./net stop
#./net start
#./hostname start
# set_parms hostname
# set_parms ip_address
# set_parms addl_netwrk
# inetd -c
Faruq
5. To stop network services:
# /sbin/init.d/net stop
# /sbin/init.d/net start
# netstat -i
# ifocnfig lan0
# lanscan
# netstat -rn
e.g. /dev/fcd0
#fcmsutil /dev/fcd0
NFS in HP-UX
Configuration Files:
/etc/exports - Contains a list of exportable file systems. This file is available in upto HP-UX 11i v2
/etc/dfs/dfstab - Contains a list of sharable file systems. This file is available from HP-UX 11i v3
/etc/rc.config.d/nfsconf - NFS server configuration file contains the nfs, autofs and mountd daemons startup
# /etc/init.d/nfs.server start
# /etc/init.d/nfs.server stop
Faruq
3. To export or share a file system :
Device Management
All the devices are communicated by HP Unix using their device files which are located under /dev directory. Most of
the devices and their device files are configured automatically during the boot time. On boot time, HP Unix try to
connect all devices and executes. /sbin/ioinit.rc script will create new device files if needed.
2. To list the available disk/CD Drives along with their device file details:
# ioscan -funC disk
# insf -C tape
http://mailsinto.blogspot.com/p/users-and-groups.html
Faruq