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
cd $ECLIPSEHOME

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:

ECLIPSEHOME=/u2/eclipse
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
    done
}

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.

 

How do I remove a Linux Eterm user via the GUI?

Warning: As always, please exercise caution when performing system maintenance, especially when initiating processes that can potentially delete data.

To remove a Linux Eterm user using the GUI:

  • System -> Administration -> Users and Groups
  • Select the user from the list
  • Select the Delete button
  • Verify that the dialog box says “I won’t delete username’s home directory (‘/u2/eclipse’)” before selecting Yes to proceed

Warning: if prompted to remove the shared home directory as shown in the dialog box below, uncheck the box before clicking Yes. Failure to do so will result in the removal of the entire Eclipse database directory (/u2/eclipse).

For your convenience, here is a screencast that covers the entire process for locking or removing a user:

If you prefer to use the command line, please see this page for instructions.

How do I remove a Linux Eterm user via the command line?

Warning: As always, please exercise caution and follow best practices when performing system maintenance, especially when initiating processes that can potentially delete data.

Easy Procedure: Remove a User (Recommended)

  • Log into your server as root
  • Remove the user (where username is the user you wish to remove):
userdel username

If you prefer the graphical interface, you may perform the same function via the GUI.

Advanced Procedure: Remove a User and Home Directory

The above command does not remove the user’s home directory, because it often contains important database files. If you would like to remove both a user and their home directory, you must first verify that your users are not configured to use the database directory as their home directory:

  • Log into the server as root
  • Verify the user’s home directory (where username is the user whose home directory you are checking):
echo ~username
  • If the output displays /u2/eclipse or anything other than /home/usernamedo not continue. This user’s home directory is the shared database directory. You must use the procedure above to remove only the user. Contact Eclipse Support with any questions.
  • If the output displays /home/username, you may proceed with the procedure and remove the user and their home directory:
userdel -r username