How to create a user on Ubuntu and save it to a different disk?
To create the home directory of new users on another disk, you can follow these steps:
- information
sudo mkdir /data/userhome
- create a new user
- – newcomer
sudo useradd -d /data/userhome/newuser newuser
- Next, the permission settings for the home directory of the new user should be set to the owner and group of the new user.
sudo chown newuser:newuser /data/userhome/newuser
- Finally, establish a password for the new user.
sudo passwd newuser
You have successfully created the home directory for the new user on a different drive. The user can now log in using the new username and password, and their home directory will be located in the /data/userhome/newuser directory.