It might be THE most used and powerful command among Ubuntu users, as it has become the preferred method in that distribution. Now that you have the power, be sure to be safe when you issue your commands!
There is no su-undo! Check out our current free cloud courses or level up your cloud and it career path with a free trial. Get more insights, news, and assorted awesomeness around all things cloud learning.
Don't have an account? Share on facebook. Share on twitter. Share on linkedin. Home Engineering. Bash , Developer , Linux. Richard Layton May 17, 8 Minute Read. What is SUDO? Why is it better than the alternative? The Sudoers File This file is the seedy underbelly of sudo. Some Options Like any good command there are a few nifty options to make sudo, do more!
Get it now? The sudo command allows you to run programs with the security privileges of another user by default, as the superuser. It prompts you for your personal password and confirms your request to execute a command by checking a file, called sudoers , which the system administrator configures.
Using the sudoers file, system administrators can give certain users or groups access to some or all commands without those users having to know the root password. It also logs all commands and arguments so there is a record of who used it for what, and when. The sudo command also makes it easier to practice the principle of least privilege PoLP , which is a computer security concept that helps control system access and potential system exploits and compromises.
For more information about the sudo command, visit A. Lawrence's Using sudo page. The su command allows you to become another user. To use the su command on a per-command basis, enter:. They can help you to prevent your users from doing unexpected things in your network that could cause performance, and more importantly, security issues to occur.
When it comes to working with Linux, there are two ways to run administrative applications. Which one you use will depend on which type of Linux you have. I am going to refer to Ubuntu in this blog. Sudo stands for either "substitute user do" or "super user do" and it allows you to elevate your current user account to have root privileges temporarily.
Once that time expires, you have to enter your password again to regain root privilege. Having root user privileges can be dangerous, but using sudo instead of su can help you keep your system secure. If you are using Linux and you want your actions to be safe, you need to know and understand these two commands.
In Ubuntu Linux, the root account is not configured by default. Whenever a user tries to install, remove or change any piece of software, he has to have the root privileges to perform such tasks.
The sudo command is used to give such permissions to any particular command that a user wants to execute once the user enters a user password to give system based permissions.
The user will be prompted for the password of the user to which he or she is switching. Here is an example:. The per can also use it to switch to the root account.
If you use a traditional Linux setup, you are familiar with using the su command to gain root privileges. You can use it to log in as the root. If you are using a type that relies on su and allows root user login, log in as your standard user and su to the root user. In fact, using Ubuntu, the root user account is disabled, thank goodness. You also cannot use su to become the root user. You can only issue commands using sudo to gain administrative privileges. I caution you to ensure this is appropriate for your security needs before providing a user the power of sudo.
Using the basic form of sudo is pretty simple. This does not give any output. So, the next time sudo is run a password will be required. This option does not require a password and was added to allow a user to revoke sudo permissions from a. Likewise, this option does not require a password.
Note that if you use the -b option you cannot use shell job control to manipulate the process. Normally we get this for a sudo command: Using sudo -p we get, 9. To specify a uid instead of a username, use uid. By default, sudo does not modify HOME.
0コメント