Manajemen User Linux via Terminal
Menambah User => $ sudo adduser username_baru
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | sudo adduser linus Adding user `linus' ... Adding new group `linus' (1002) ... Adding new user `linus' (1002) with group `linus' ... Creating home directory `/home/linus' ... Copying files from `/etc/skel' ... Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for linus Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] y |
Mengganti Password => $ sudo passwd username
1 2 3 4 | sudo passwd linus Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully |
Mengeset Group => $ sudo usermod -a -G namagroup username
1 | sudo usermod -a -G sudo linus |
Perintah diatas untuk memasukkan user linus ke group sudo agar user linus bisa menjadi root atau menjalankan perintah sudo di Ubuntu.
Mengecek Group sebuah User => $ groups username
1 2 | groups linus linus : linus sudo |
Selain perintah diatas bisa juga dengan mengecek file group
1 2 | sudo nano /etc/group sudo:x:27:musa,linus |
Menghapus User => $ sudo deluser username
1 2 3 4 | sudo deluser linus Removing user `linus' ... Warning: group `linus' has no more members. Done. |
selamat mencoba 😀
referensi :
liberiangeek.net
howtogeek.com