How to specify a custom home directory?

QuestionsQuestions8 SkillsProUser Account ManagementNov, 21 2025
0139

To specify a custom home directory when creating a new user with the useradd command, you can use the -d option followed by the desired path. You should also include the -m option to ensure that the home directory is created if it does not already exist.

Here’s an example:

sudo useradd -m -d /path/to/custom/home newuser

In this command, replace /path/to/custom/home with the path where you want the home directory to be created, and newuser with the desired username.

0 Comments

no data
Be the first to share your comment!