Jumat, 21 September 2018

How to create ubuntu sudoer user using command line

  Tidak ada komentar
As linux admin, some day you need to add new user to your linux sistem, most of linux system have no gui, they accessed via terminal, here i share to you how to add new user and grant his privileges to be sudoer using command line in terminal on ubuntu os.

Create user by typing following command : adduser [username] as shown on following figure
team@Lenovo-G470:~$
team@Lenovo-G470:~$ sudo adduser maswachid
Adding user `maswachid' ...
Adding new group `maswachid' (1004) ...
Adding new user `maswachid' (1003) with group `maswachid' ...
Creating home directory `/home/maswachid' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for maswachid
Enter the new value, or press ENTER for the default
        Full Name []: mas wachid
        Room Number []: 1
        Work Phone []: 0822
        Home Phone []: 0856
        Other []: indonesia
Is the information correct? [Y/n] Y
team@Lenovo-G470:~$

Add the user to sudo group in other the user grant sudoer privileges
team@Lenovo-G470:~$
team@Lenovo-G470:~$ sudo usermod -aG sudo maswachid
team@Lenovo-G470:~$
team@Lenovo-G470:~$ groups maswachid
wachid : maswachid sudo
team@Lenovo-G470:~$

Tidak ada komentar :

Posting Komentar