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
useraddLow level-p* -m -k -G -s No
adduserHigh levelYes No 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

How adduser and useradd differ across distros

adduser

  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

useradd

  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)