How to change root home directory

From Wiki-UX.info
Jump to: navigation, search

Abstract[edit]

Provided that it is needed to change root user's home directory from / to /root, here is the procedure to achieve it. The /root can be switched to any other directory, as long as it is under root filesystem.

Procedure[edit]

1. Edit /etc/passwd and change root's entry from:

root:*:0:3::/:/sbin/sh

to:

root:*:0:3::/homeroot:/sbin/sh

2. Create the directory and setup the proper permissions:

# mkdir /homeroot
# chmod 700 /homeroot

3. Move all the hidden files to the new home directory:

# mv /.[a-zA-Z]* /root

4. Update the Trusted System Database (TCB) if required:

# pwconv

5. Test if you can login properly without closing the current session.

Reference[edit]

  • HP-UX 11i v3 Installation and Update Guide: HP Integrity Servers and HP 9000 Servers - Chapter 5 Cold-Installing HP-UX 11i v3

http://bizsupport1.austin.hp.com/bc/docs/support/SupportManual/c02751564/c02751564.pdf

Authors[edit]