Change user directory
Use sudo
and at
to schedule the usermod
command, which changes the user's home dir.
sudo at "now +5 minutes" # Run the following commands in 5 minutes
In the at
interface
usermod -m -d /new/home/path # Change user home dir (-d) and move (-m) the content into the new folder
Ctrl+D
to exit the at
interface. Logout, wait 10 minutes, and login.