New answers tagged useradd
The problem is indeed what @LuisAntolin pointed out. On Ubuntu systems, and most others, the default shell is /bin/sh. This is a symlink to /bin/dash on Debian-based systems. dash has no history command which is why you're getting that error. While you can indeed change this by editing /etc/password, a better way is to run chsh as the user ubuntu and set ...
It looks like your shell is not being bash but plain sh. Super quick solution: just execute bash and see if that helps. For a better and permanent solution please check /etc/passwd and see what shell does the user have there. If you find /bin/sh change it for /bin/bash
Use "newusers". Explained in this post.
No this is not possible using the Unix permissions models that are available via the /etc/passwd and /etc/shadow files and sudo. One method that I've seen used in the past, was to provide a frontend web application and/or program or shell script that that could execute via sudo, but nothing else. This would provide them an API to perform a very narrow set ...
I don't know what you mean by "next available" with respect to the $HOME and $SHELL variables. Those you just set to their defaults: /home/USERNAME and /bin/bash or whatever. For the $HOME, just make sure the directory does not exist ([ -e "/home/$username" ] && echo "Directory exists"). As for the groups, just list the available groups and take ...
Top 50 recent answers are included