Home > computers > linux > AddUserVSUserAdd | About

level Sets password Creates the HOME dir Creates config. files (KDE, Mozilla, Gnome…) Adds user to group Set shell Consistent across ditros
useradd Low level -p* -m -k -G -s No
adduser High level Yes Yes Yes Yes Yes No

'*' : it has to be a 'crypt' encrypted password, and this option is not recommended.

Adding a user with useradd

useradd username -m 
passwd username

Adding a user with adduser

adduser username

(answer questions) To disable questions use –gecos GECOS

adduser --gecos GECOS username

Add an existing user to an existing group

usermod -a -G groupname username

How adduser and useradd differ across distros


  1. Debian-based : this is perl script that asks questions
  2. Redhat-based : this is symlink to useradd
  3. Suse : adduser doesn't even exist


  1. suse-based :
    1. you can create users directly in LDAP. This is inexistant in readhat-based distros
    2. –prefered-uid option tries to affect the desired uid if it's available, or the next available one. This is not available in redhat-based distros
  2. FreeBSD : the command doesn't exist.

contact : @ychaouche yacinechaouche at yahoocom

QR Code
QR Code Adding a user with useradd (generated for current page)