Creating a new user on Ubuntu 18.04

hello everyone
I need help with adding a new user on Ubuntu 18.04 server. How do I do that while sudo package is not installed the server and once I install it root is not allowed to use the command sudo.

You’re already root. Don’t need to sudo if you’re root.

Just adduser.

yeah but I need to create another user so that I don’t use root for other programs

I did
adduser diyaa

then once I did
su diyaa the server says root is not in sudo group

This may not be the same on ubuntu but on arch, to add a users to groups we just do

sudo adduser -m username
sudo usermod -aG wheel,optical,storage,audio,video username

then if we want sudo privileges we have to edit the sudoers file by command sudo visudo and then uncomment line 82 to allow all members of the wheel group to execute sudo commands. That should work, but it may be different on ubuntu

1 Like