Sunday, March 8, 2009

Set user with root privileges

Artinya dari judul di atas "Men-set user dengan hak akses root", kurang lebih begitu... :D
Kita langsung aja, pertama-pertama akses sebagai root, lalu buatlah user, contoh :
# useradd cyberthug


setelah itu edit file sudoers yang terletak di folder/path /etc/sudoers, dengan editor kesukaan anda. Disini saya menggunakan vi editor.
# vi /etc/sudoers

akan tampil isi file sudoers-nya sebagai berikut :

# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults

Defaults !lecture,tty_tickets,!fqdn
# User privilege specification
root ALL=(ALL) ALL
cyberthug ALL=(ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

Dari isi file di atas saya menambahkan cyberthug ALL=(ALL) ALL, karena user tersebut yang akan kita beri hak akses setara dengan root.
Setelah itu tekan tombol Esc lalu ketik ':wq!' (tanpa tanda petik) untuk menyimpan dan keluar dari editor vi.
Smoga bermanfaat.

No comments: