If the -m option is not used with the useradd command, the new user account will be created without a home directory. This can lead to several issues:
-
No Personal Space: The user will not have a designated area to store personal files, configurations, or settings. This can hinder their ability to use the system effectively.
-
Default Configuration Issues: Many applications expect to find user-specific configuration files in the home directory. Without it, applications may not function correctly or may revert to default settings, which might not be suitable for the user.
-
Permissions and Access: The user will not have a private space to manage their files, which can lead to confusion and potential security issues, as they may inadvertently access or modify system files or other users' files.
Example Without -m
If you run the following command:
sudo useradd newuser
The user newuser will be created, but without a home directory. You can check this by listing the /home directory:
ls /home
You will not see a newuser directory listed, indicating that the home directory was not created.
Conclusion
It's generally a best practice to always use the -m option when creating new users to ensure they have a proper environment to work in. If you accidentally create a user without a home directory, you can create one manually using the mkdir command and set the appropriate permissions, but this is an extra step that can be avoided by using -m from the start.
If you have more questions or need further clarification, feel free to ask!
