HP-UX System Administrator's Guide: Configuration Management
3 Configuring Root
Traditionally, the HP-UX root user, or superuser, has used the system’s root directory,
/, as its home directory. This means that root’s supporting files, such as .profile,
.kshrc, and .sh_history, are mixed in with file system mounts and other public
data.
HP recommends that you create a separate home directory for root. Since it must be
on the root volume, rather than in the /home directory, which is often on a separate
file system, we suggest you use a directory name like /homeroot, which would reside
on the root volume. By having a private home directory, you also provide a secure
location for the root user’s private files.
This chapter describes how to configure the home directory and the environment for
the root user.
Create the Root Home Directory
You need to use HP-UX commands, rather than HP SMH.
1. Create a home directory for the root user. This directory must reside in the system
root directory (/), since it must be available whenever the system is running. A
useful directory name is /homeroot. Create it and make it accessible only by
root.
# mkdir /homeroot
# chmod 700 /homeroot
2. Modify /etc/passwd to make this new directory the home directory for the root
user, as follows. The steps are shown in the example below.
a. Use the vipw command to load /etc/passwd into vi.
b. Insert homeroot after the / in field 6 of line 1.
c. Identify the system in comments field 5.
d. Save the file and exit.
# vipw
root:3ngTYOiNJA.Mc,/0WR:0:3::/:/sbin/sh
ihomerootEsc
root:3ngTYOiNJA.Mc,/0WR:0:3::/homeroot:/sbin/sh
iMySystem Root UserEsc
root:3ngTYOiNJA.Mc,/0WR:0:3:MySystem Root User:/homeroot:/sbin/sh
:wq
#
Create the Root Home Directory 47