users

The useradd command with the -b option creates a base directory for the user account. The home directory is always the concatenation of the base directory and the user account name, according to Linux man pages.

user01@rhel10-vm4:~$ sudo useradd user02 -b /myBaseDir
Creating mailbox file: File exists
user01@rhel10-vm4:~$
user01@rhel10-vm4:~$ sudo su - user02
Last login: Fri Oct  2 01:27:39 EDT 2026 on pts/3
user02@rhel10-vm4:~$ pwd
/myBaseDir/user02
user02@rhel10-vm4:~$

I delete the user account, recreate it without the -b option and check its home directory again: