Your best source of information and news about windows vista , hardware and drivers on the internet La tua migliore fonte di informazioni e notizie su Windows Vista, l'hardware e driver su Internet

Vista ARTICLES Vista ARTICOLI TOP 50 TOP 50 Spyware Virus Virus Spyware Vista SOFT Vista SOFT Vista HELP Vista AIUTO

sudo: Running a Command with root Privileges sudo: Esecuzione di comandi con privilegi di root


Classically a user gained root privileges by logging in as root or by giving an su (substitute user) command and providing the root password. Classicamente un utente con privilegi di root guadagnato l'accesso come root o dando uno su (sostituto utente) comando e fornendo la password di root. When an ordinary user executed a privileged command in a graphical environment, the system would prompt for the root password. Quando un normale utente privilegiato comando eseguito in un ambiente grafico, il sistema rapido per la password di root. More recently the use of sudo (www.sudo.ws) has taken over these classic techniques of gaining root privileges. Più di recente l'uso di sudo (www.sudo.ws) ha ripreso queste tecniche classiche di acquisire i privilegi di root.

As installed, Ubuntu locks the root account by not providing a root password. Come installare, Ubuntu si blocca l'account di root da non fornire una password di root. This setup prevents anyone from logging into the root account (except when you bring the system up in recovery mode). Questa impostazione impedisce a chiunque di accedere a l'account di root (tranne quando si mettono il sistema in modalità di ripristino). There is, however, a root account (a user with the username root—look at the first line in /etc/passwd). Vi è, tuttavia, un account di root (utente con il nome utente root-guarda la prima riga in / etc / passwd). This account/user owns files (give the command ls –l /bin) and runs processes (give the command ps –ef and look at the left column of the output). Questo account / utente possiede file (dare il comando ls-l / bin) e gestisce i processi (dare il comando ps-ef e guardare la colonna di sinistra della produzione). The root account is critical to the functioning of an Ubuntu system. L'account di root è un fattore critico per il funzionamento di un sistema Ubuntu. The sudo utility enables you to run a command as though it had been run by a user logged in as root. Sudo Il programma di utilità permette di eseguire un comando come se fosse stato eseguito da un utente loggato come utente root.

Ubuntu strongly encourages the use of sudo. Ubuntu incoraggia vivamente l'uso di sudo. In fact, as shipped, Ubuntu locks the root account (there is no password) so you cannot use the classic techniques. In realtà, come inviati, Ubuntu si blocca l'account di root (non vi è nessuna password) in modo non è possibile utilizzare le classiche tecniche. There are many advantages of using sudo over using the root account for system administration: Ci sono molti vantaggi di utilizzare sudo su utilizzando l'account di root per l'amministrazione di sistema:

• When you run sudo, it requests your password—not the root password— so you have to remember only one password. • Quando si esegue sudo, chiede la password, non la password di root, in modo da avere a ricordare una sola password.

• The sudo utility logs all commands it executes. • Il programma di utilità sudo log esegue tutti i comandi. This log can be useful for retracing your steps if you make a mistake and for system auditing. Questo log può essere utile per ripercorrere i tuoi passi, se si commette un errore e per il sistema di revisione contabile.

• The sudo utility allows implementation of a finer-grained security policy than does the use of su and the root account. • Il programma di utilità sudo permette l'attuazione di una grana più fine della politica di sicurezza che non l'uso di su e l'account di root. Using sudo, you can enable specific users to execute specific commands—something you cannot do with the classic root account setup. Utilizzo di sudo, è possibile consentire agli utenti di eseguire specifici comandi specifici-qualcosa che non può che fare con la classica configurazione dell'account root.

• Using sudo makes it harder for a malicious user to gain access to a system. • Utilizzo di sudo rende più difficile per un utente malintenzionato di accedere ad un sistema. When there is an unlocked root account, a malicious user knows the username of the account she wants to crack before she starts. Quando vi è una sbloccato l'account root, un utente malintenzionato conosce il nome del conto vuole rompere prima che inizi. When the root account is locked, the user has to determine the username and the password to break into a system. Quando l'account di root è bloccato, l'utente deve determinare il nome utente e la password per penetrare un sistema.

Some users question whether sudo is less secure than su. Alcuni utenti questione se sudo è meno sicura su. Because both rely on passwords, they share the same strengths and weaknesses. Poiché entrambi contare su una password, che condividono gli stessi punti di forza e di debolezza. If the password is compromised, the system is compromised. Se la password è compromessa, il sistema è compromessa. However, if the password of a user who is allowed by sudo to do one task is compromised, the entire system may not be at risk. Tuttavia, se la password di un utente che è consentito dal sudo per eseguire una funzione è compromessa, l'intero sistema non può essere a rischio. Thus, if used properly, the finer granularity of sudo’s permissions structure can make it a more secure tool than su. Pertanto, se utilizzata correttamente, la più fine granularità dei permessi sudo della struttura può rendere più sicuro uno strumento più su. Also, when sudo is used to invoke a single command, it is less likely that a user will be tempted to keep working with root privileges than if the user opens a root shell with su. Inoltre, quando sudo è utilizzato per richiamare un singolo comando, è meno probabile che un utente sarà la tentazione di continuare a lavorare con i privilegi di root che se l'utente apre una shell di root con su.

Using sudo may not always be the best, most secure way to set up a system. Utilizzo di sudo non può essere sempre il migliore, più sicuro modo di creare un sistema. On a system used by a single user, there is not much difference between using sudo and carefully using su and a root password. Su un sistema utilizzato da un singolo utente, non vi è molta differenza tra l'uso di sudo e accuratamente con su e una password di root. In contrast, on a system with several users, and especially on a network of systems with central administration, sudo can be set up to be more secure than su. Al contrario, su un sistema con più utenti e, in particolare, su una rete di sistemi con l'amministrazione centrale, sudo può essere impostato per essere più sicuro su. If you are a dyed-in-the-wool UNIX/Linux user who cannot get comfortable with sudo, it is easy enough to give the root account a password and use su. Se sei un tinto-in-the-lana UNIX / Linux che non riescono proprio agio con sudo, è facile abbastanza per dare l'account di root e l'uso di una password su.

When you install Ubuntu, the first user you set up is included in the admin group. Quando si installa Ubuntu, il primo utente si imposta è inclusa nel gruppo admin. As installed, sudo is configured to allow members of the admin group to run with root privileges. Come installare, sudo è configurato in modo da consentire ai membri del gruppo l'amministratore per eseguire, con privilegi di root. Because there is no root password, initially the only way to perform privileged administrative tasks from the command line is for the first user to run them using sudo. Poiché non vi è alcuna password di root, inizialmente l'unico modo per svolgere compiti amministrativi privilegiata dalla riga di comando per il primo utente ad eseguire l'uso di sudo. Graphical programs call other programs, such as gksud, which in turn call sudo for authentication. Programmi di grafica chiamata altri programmi, come gksud, che a sua volta chiamata sudo per l'autenticazione.


Timestamp
By default, sudo asks for your password (not the root password) the first time you run it. Per impostazione predefinita, sudo chiede la password (non la password di root), la prima volta che si esegue esso. At that time, sudo sets your timestamp. A quel tempo, imposta il timestamp di sudo. After you supply a password, sudo will not prompt you again for a password for 15 minutes, based on your timestamp. Dopo aver fornito una password, sudo non è ancora pronta per una password per 15 minuti, in base alle vostre timestamp.


sudo’s environment sudo l'ambiente
The pwd builtin in the preceding example shows one aspect of the modified environment the –i option creates. La pwd incorporato nel precedente esempio mostra un aspetto di ambiente modificato l'opzione-i crea. This option spawns a root login shell (a shell with the same environment as a user logging in as root would have) and executes root’s startup files. Questa opzione genera una root shell (una shell con lo stesso ambiente, come un utente l'accesso come root sarebbe) ed esegue il file di avvio di root. Before issuing the sudo –i command, the pwd builtin shows /home/sam as Sam’s working directory; after the command it shows /root, root’s home directory, as the working directory. Prima di rilasciare il comando sudo-i, la mostra builtin pwd / home / sam come Sam's directory di lavoro; dopo il comando mostra / root, home directory di root, come la directory di lavoro. Use the –s option to spawn a root shell without modifying the environment. Usa l'opzione-s opzione per generare una shell di root, senza modificare l'ambiente. When you call sudo without an option, it runs the command you specify in an unmodified environment. Quando si chiama sudo senza opzione, si esegue il comando che si specifica in un ambiente non modificato. To demonstrate, the following example has sudo run pwd without an option. Per dimostrare il seguente esempio sudo ha eseguito pwd senza un'opzione. The working directory of a command run in this manner does not change. La directory di lavoro di un comando eseguito in questo modo, non cambia.


Redirecting output Reindirizzamento di uscita
The following command fails because, although the shell that sudo spawns executes ls with root privileges, the nonprivileged shell that the user is running redirects the output. Il seguente comando non riesce, perché, anche se il serbatoio che genera esegue sudo ls con privilegi di root, il guscio nonprivileged che l'utente è in esecuzione reindirizza l'output. The user’s shell does not have permission to write to /root. L'utente della shell non hanno il permesso di scrivere a / root. There are several ways around this problem. Ci sono diversi modi ovviare a questo problema. The easiest is to pass the whole command line to a shell running under sudo: The bash –c option spawns a shell that executes the string following the option and then terminates. Il metodo più semplice è di passare l'intera linea di comando di una shell che gira sotto sudo: bash-c opzione genera una shell che esegue la stringa seguente l'opzione e poi termina. The sudo utility runs the spawned shell with root privileges. L'utilità esegue il sudo generato shell con i privilegi di root. You can quote the string to prevent the nonprivileged shell from interpreting special characters. Si può citare la stringa per prevenire la nonprivileged shell da interpretare caratteri speciali. You can also spawn a root shell with sudo –i, execute the command, and exit from the privileged shell. È anche possibile generare una shell di root con sudo-i, eseguire il comando, e uscire dal guscio privilegiato.


Options Opzioni
You can use command line options to control how sudo runs a command. È possibile utilizzare opzioni della riga di comando per controllare come viene eseguito un comando sudo. Following is the syntax of an sudo command line: In seguito è la sintassi di un comando "sudo-line:

sudo [options] [command] sudo [opzioni] [comando]

where options is one or more options and command is the command you want to execute. dove opzioni è una o più opzioni e di comando è il comando che si desidera eseguire. Without the –u option, sudo runs command with root privileges. Senza l'opzione-u, viene eseguito il comando sudo con privilegi di root. Some of the more common options follow; see the sudo man page for a complete list. Alcune delle più comuni opzioni seguire; sudo vedere la pagina man per una lista completa.

–b (background) Runs command in the background. -B (sfondo) Esegue il comando in background.

–i (initial login environment) Spawns the shell that is specified for root (or another user specified by –u) in /etc/passwd, running root’s (or the other user’s) startup files, with some exceptions (eg, TERM is not changed). -I (login iniziale ambiente) genera il serbatoio che è specificato per root (o un altro utente specificato dal-u) in / etc / passwd, in esecuzione di root (o gli altri utenti), i file di avvio, con alcune eccezioni (ad esempio, , il termine non è cambiato). Does not take a command. Non prende un comando.

–k (kill) Resets the timestamp (page 491) of the user running the command, which means the user must enter a password the next time she runs sudo. -K (kill) Reimposta il timestamp (pagina 491) l'utente esegue il comando, il che significa che l'utente deve inserire una password la prossima volta che si esegue sudo.

–L (list defaults) Lists the parameters that you can set on a Defaults line (page 497) in the sudoers file. -L (lista di default) Elenca i parametri che è possibile impostare su una linea Predefiniti (pagina 497) nel sudoers file. Does not take a command. Non prende un comando.

–l (list commands) Lists the commands the user who is running sudo is allowed to run on the local system. -L (lista comandi) Elenca i comandi l'utente che esegue sudo è consentito di eseguire sul sistema locale. Does not take a command. Non prende un comando.

–s (shell) Spawns a new root (or another user specified by –u) shell as specified in the /etc/passwd file. -S (shell) genera una nuova root (o un altro utente specificato dal-u), della shell, come specificato nel file / etc / passwd. Similar to –i but does not change the environment. Simile a-i, ma non modifica l'ambiente. Does not take a command. Non prende un comando.

–u user Runs command with the privileges of user. -U utente esegue il comando con i privilegi di utente. Without this option sudo runs command with root privileges. Senza questa opzione viene eseguito il comando sudo con privilegi di root.

Source of Information : McGraw Hill Osborne Media How to Do Everything Ubuntu Fonte di informazione: McGraw Hill Osborne Media Come fare tutto Ubuntu

Popularity: 1% Popularity: 1%


Written by magakos. Scritto da magakos. Read more great feeds at is source Per saperne di più grande al feed è fonte WEBSITE SITO WEB
no comments Non ci sono commenti . .
Read more articles on Per saperne di più articoli su Ubuntu Linux Ubuntu Linux and e otherSoftware otherSoftware . .

Related articles Articoli correlati

No comments Non ci sono commenti

There are still no comments on this article. Non ci sono ancora commenti su questo articolo.

Leave your comment... Lascia il tuo commento ...

If you want to leave your comment on this article, simply fill out the next form: Se si desidera lasciare il tuo commento su questo articolo, è sufficiente compilare il modulo successivo:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> . È possibile utilizzare questi tag XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i > <strike> <strong>.