How do I update a Linux user’s home directory?

For more information on the new home directory format, please see this advisory.
Before making changes to your system, please review the general system administration best practices.

To migrate existing Linux users’ home directories to the new format:

Verify that /u2/eclipse/.profile has been updated:

vi /u2/eclipse/.profile

The following block of code must appear before “Setup the Eclipse environment.” If it doesn’t, add it:

# Move to the Eclipse account home directory
export ECLIPSEHOME=/u2/eclipse

After the .profile has been updated, backup the existing /etc/passwd file containing user information:

TIMESTAMP=`date +%Y%m%d.%H%M%S`
echo "`date`: backing up /etc/passwd to /etc/passwd.$TIMESTAMP"
cp /etc/passwd /etc/passwd.$TIMESTAMP

Run the following script to update the existing user’s home directories:

echo "`date`: started user migration"
awk -F":" '{ print $1 " " $6 }' /etc/passwd | egrep "$ECLIPSEHOME$" | sort | {
    while read LINE; do
        USERNAME=$(echo $LINE | awk '{print $1}')
        ECLIPSEHOME=$(echo $LINE | awk '{print $2}')
        echo "`date`: Setting $USERNAME's home directory to /home/$USERNAME with a link to $ECLIPSEHOME/.profile"
        mkdir -p /home/$USERNAME
        chown $USERNAME /home/$USERNAME
        usermod -d /home/$USERNAME $USERNAME
        ln -sf $ECLIPSEHOME/.profile /home/$USERNAME/.profile
        ln -sf $ECLIPSEHOME/.profile /home/$USERNAME/.bash_profile

Log in as an Eterm user to verify that the steps been completed properly. If you encounter any issues, please open a support request.

Review the updated user maintenance procedures.