
Why do we use su - and not just su? - Unix & Linux Stack Exchange
Feb 7, 2011 · su - username sets up the shell environment as if it were a clean login as the specified user, it access and use specified users environment variables, su username just starts a shell with current environment settings for the specified user. If username is not specified with su and su -, the root account is implied as default.
What are the differences between "su", "sudo -s", "sudo -i", "sudo …
Oct 22, 2011 · su lets you switch user so that you're actually logged in as root. sudo -s runs a shell with root privileges. sudo -i also acquires the root user's environment. To see the difference between su and sudo -s, do cd ~ and then pwd after each of them. In the first case, you'll be in root's home directory, because you're root.
What is the difference between 'su -' and 'su root'? [duplicate]
su - switches to the superuser and sets up the environment so that it looks like they logged in directly. su root switches to the user named root and doesn't simulate directly logging in. If the superuser is named root, then su and su root are equivalent (and don't simulate directly logging in), as are su - and su - root (which do).
su - user Vs sudo su - Unix & Linux Stack Exchange
Aug 22, 2018 · Secondly: sudo -i and su - do the same thing (su - is equivalent to su --login), using different authorization mechanism: su verifies the password for the root account, while sudo verifies the password for your current user account and also verifies that your current user account is allowed to run administrative operations according to the /etc/sudoers policy.
command line - difference between sudo su - and su - - Ask Ubuntu
With su - you will be asked to authenticate with the root password. This only works if you have set the root password. This only works if you have set the root password. In terms of functionality, you can use either one for anything and they will do it the same, but sudo su - can be easier to get into if you have sudo privileges with NOPASSWD.
su vs sudo -s vs sudo -i vs sudo bash - Unix & Linux Stack Exchange
su - means environment variables will be reset to root and su means environment variables as old user. for example: root's home directory if you use su - or old user home directory if you use su . sudo ( s uper u ser do ) is a command-line utility that allows users to run programs with the security privileges of another user, by default is ...
How does the "su" command work? - Unix & Linux Stack Exchange
Jul 24, 2017 · The su executable has a special permission bit on it, called the "set-user-ID bit" or "setuid" which causes it to execute such that the effective user ID of the process is that of the owner of that executable file. If su successfully authenticates, it then executes a new shell.
What's the difference between sudo su - and sudo su
I will create a question from it but sudo su - and sudo su -l differs. On an account where I ssh into with a key only, and I have sudo rights to change to a specific other user, sudo su - changes the user without problems but sudo su -l or sudo su --login will ask for a sudo password, which I don't have (although by examining sudo -l I could execute /bin/su with NOPASSWD)
Why does su fail with "authentication error"? - Ask Ubuntu
However, the OP has asked specifically about su to root. I was assuming they knew why they want to do that and that they have a good reason to do it. So I was adding an alternate path to becoming root to the discussion. And here is yet another way: sudo -i then su. But I would totally agree that in most cases just using sudo should be fine ...
'sudo su -' vs 'sudo -i' vs 'sudo /bin/bash' - when does it matter ...
Nov 13, 2013 · su - The command su is used to switch to another user (s witch u ser), but you can also switch to the root user by invoking the command with no parameter. su asks you for the password of the user to switch, after typing the password you switched to the user's environment. sudo - sudo is meant to run a single command with root privileges.