linux add home directory to user code example
Example 1: assign home directory to user linux
usermod -d /path/to/dir username
Example 2: linux add homedir
mkdir /home/$user
usermod -d /home/$user $user
usermod -d /path/to/dir username
mkdir /home/$user
usermod -d /home/$user $user