On both CentOS and Red Hat Linux systems you can easily create new user accounts with their own home directories.
Here’s how you do this from the command line. I’m assuming you’re logged in as root, and the new user we’d like to create is called “testuser”:
Let’s give our testuser a password so s/he can login to the system via SSH:
This will prompt for a new password (twice), followed by the message that “all authentication tokens have been updated”. Which is nice.
You can now login as “testuser” with your designated password. Testuser’s home directory is located here:
That’s all there’s to it – congratulations on creating a new user on your system 😉
Removing a User Account
If you’re done with the account you can remove it with
The data in this user’s home directory will still be intact, even when the user is removed. In case you’d like to do some house cleaning, you can pass -r which will remove the user’s directory and all contents he may have had:
userdel -r testuser