Linux – Ubuntu server – adduser and create home directory structure without logging in

linuxUbuntu

I need to create a new user for an app (a standard user because it requires a user directory structure). However, I noticed adduser only creates the user home directory structure after the first login of that user.

I only plan to use the account with su to run the app. Is there any way I can create the user directories without logging in remotely first?

Best Answer

If you want to create the home directory when creating the user with no login needed:

useradd -m username

In the Debian/Ubuntu/Mint family, adduser and useradd are separate commands but in the Fedora/RHEL/CentOS family, /usr/sbin/adduser is a symlink to /usr/sbin/useradd and in OpenSuse, adduser doesn't exist by default.

Related Topic