leisureleft.blogg.se

Sudo su run command
Sudo su run command













sudo su run command
  1. #Sudo su run command how to#
  2. #Sudo su run command password#

You can use sudo su to switch to the super user account. However, if you want to run a command as another user, you need to specify that with -u.

sudo su run command

So sudo -u root command is the exact same thing as sudo command. To run a command as a root user, just run sudo space the command you want to execute. To see the commands that are available for you to run with sudo, use sudo -l. Of course, on your personal system, you have access to the root account and you are effectively the system administrator as well. The sudo configuration is typically controlled by the system administrator and requires root access to change. If the sudo configuration permits access, that command is executed. When you execute the sudo command, you are prompted for your password.

sudo su run command

This can eliminate some issues that arise from using shared passwords and generic accounts.

#Sudo su run command password#

One of the advantages of using sudo over the su command is that you don't need to know the password of the other user. It is commonly used to install, start, and stop applications that require root privileges. This is why sudo is referred to as superuser do. Like su, if no username is specified, it assumes that you are trying to run commands as the super user. Sudo allows you to run programs with a security privileges of another user. Let's use a dash to say, "Let's get oracle's environment." And now you can see that that environment variable that exists in the oracle account is accessible to us.Īnother way to switch users or execute commands as others is to use the sudo command.

sudo su run command

We didn't specify that we wanted oracle's environment. Also, we ended up in the oracle's home directory. And you can see that our environment variable of TEST was not passed on when we su - to the oracle user. Let's use su with a dash to get oracle's environment. Our environment exist after we changed to the oracle user. And you can see that that environment variable is passed on. Now let's use the su command to switch to the oracle user for instance. Let's set an environment variable to test with. If you run whoami, it should return your current account name, and after you su or switched to another user, whoami should return that user account's name. If you want to know what user you are working as, run the whoami command. If the command you want to execute is more than one word in length, then you need to surround it with quotes. Use the -c option to su, to specify command to be executed. In that case, su creates an environment like you would expect to see had you logged in as that user. Your current environment is passed to the new shell unless you specify a hyphen or a dash. If no arguments are supplied to su, it assumes that you are trying to become the super user or root account.Įxecuting su without any options is the same thing as executing su root. One way to start a session as another user on the system is to use the su command.

#Sudo su run command how to#

This lesson will cover how to switch to other accounts and how to run commands and programs as other users.















Sudo su run command