Change Home Directory in Linux: Quick Guide

In a Linux system, you can specify a user’s home directory by changing their home directory path. Here is one way to do it:

  1. Open the terminal and log in as the root user or a user with sudo privileges.
  2. Modify the user’s home directory path using the following command:
sudo usermod -d /new/home/directory username

Replace “/new/home/directory” with the new home directory path you want to specify and replace “username” with the username you want to modify.

  1. Make sure the new main directory path exists and has the appropriate permissions.
  2. Please log in again for the changes to take effect.

By following the above steps, you can successfully specify the user’s home directory path.

bannerAds