I have a fresh version of Ubuntu 16.04.1 installed and have tried to create a new user account through root. I have changed the SHELL line in /etc/default/useradd to read as follows:SHELL=/bin/bash(it previously read /bin/sh)Executing useradd -D provides the following output:GROUP=100HOME=/homeINACTIVE=-1EXPIRE=SHELL=/bin/bashSKEL=/etc/skelCREATE_MAIL_SPOOL=noI then try to create a user as follows:useradd -m -G sudo -c David Buckley davidYet the default shell is still /bin/sh. More specifically, the /etc/passwd file reads as follows:david:x:1000:1000:David Buckley:/home/david:On a slightly, potentially related note, the new user does not receive sudo access. It is given the groups david sudo, and the /etc/sudoers file includes the lines (uncommented):# Allow members of group sudo to execute any commandsudo    ALL=(ALL:ALL) ALLWhat might I be doing wrong to cause this?
Default shell not being selected with useradd
shell;ubuntu;sudo;useradd
Oddly enough, this happened to me too yesterday on a server running Ubuntu 16.04 LTS.I have no concrete answer as to why this happens, but here is a quick solution that worked for me:Don't use useradd, use adduser instead!DESCRIPTIONadduser and  addgroup  add  users  and  groups  to the system         according to command line options and  configuration  information  in /etc/adduser.conf.  They are friendlier front ends to         the low level tools like useradd, groupadd  and  usermod  programs,  by  default  choosing Debian policy conformant UID and         GID values, creating a home directory with skeletal configuration,  running  a  custom script, and other features.As for sudo, you have to log out that user  and then log back in  for the new group settings to have an effect.Here's a good link on useradd vs adduser.