By 20 Luglio 2016 0 Comments

Aggiungere un utente a sudoers

Se dovete abilitare un utente affinché possa utilizzare il comando “sudo”, occorre aggiungerlo ai sudo users (sudoers).

Per fare ciò, dobbiamo editare il file

/etc/sudoers

con il comando “visudo” da utente root:

[testuser@ubuntu~]$ su – -c visudo
Password: (inserite la password di root).

Ora andiamo ad aggiungere l’utente, sotto la riga relativa a root (per andare in modalità inserimento, premete ESC e poi “i”. In basso compare la scritta “– INSERT –“):

## Next comes the main part: which users can run what software on
## which machines (the sudoers file can be shared between multiple
## systems).
## Syntax:
##
## user MACHINE=COMMANDS
##
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
testuser ALL=(ALL) ALL
[…]

(al posto di “testuser” mettete l’utente che volete aggiungere ai sudoers).

Ora salvate e chiudete il file (premete ESC e poi digitate “:wq” senza virgolette).

Fate una prova per vedere se funziona “sudo”:

[testuser@ubuntu~]$ cat /etc/sudoers
cat: /etc/sudoers: Permission denied

[testuser@ubuntu~]$ sudo cat /etc/sudoers
[sudo] password for testuser: (mettete la password dell’utente e vedrete che stamperà il contenuto del file)

aggiungere utente a sudoers

Posted in: Linux

About the Author:

shared on wplocker.com