Sunday, November 12, 2017

sudo - How can I create an administrator user from the command line?



I want to create a user with administrative privileges and all the regular setups like home directory.





  1. Is there a adduser parameter to give the user sudo powers automatically?

  2. What are the default settings for adduser? Will it automatically create home directories and all the other things without extra parameters? (i.e. is adduser enough?)



Add the user to the sudo group with:



adduser  sudo


(If you're running Ubuntu 11.10 or earlier, use the admin group.)




Default values are stored in /etc/adduser.conf, you can check them with



less /etc/adduser.conf


To create a user and add it directly to the sudo group use



adduser  --group sudo



(Again, use admin in place of sudo for 11.10 and earlier.)



Have a look at all the options you have with adduser here.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...