|
- What are the differences between su, sudo -s, sudo -i, sudo su?
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
- Why do we use su - and not just su? - Unix Linux Stack Exchange
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
- su - user Vs sudo su - Unix Linux Stack Exchange
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
- Is there a single line command to do `su`? - Ask Ubuntu
If you write a password in a command like su <username> -p <password>, it would be stored in plain text in your bash history This is certainly a huge security issue If you need to run commands with su (or sudo) in an automated way, write a shellscript containig the commands without su or sudo and run su <username> script sh
- bash - su options - running command as another user - Unix Linux . . .
$ sudo su -c whoami nobody [sudo] password for oli: nobody When your command takes arguments you need to quote it If you don't, strange things will occur Here I am —as root— trying to create a directory in home oli (as oli) without quoting the full command: # su -c mkdir home oli java oli No passwd entry for user ' home oli java'
- 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 do I set the root password so I can use su instead of sudo?
Stack Exchange Network Stack Exchange network consists of 183 Q A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers
- sudo - How do I login as root? - Ask Ubuntu
sudo su - to execute a login shell as root after auhenticating sudo, and that shell will not need sudo to run admin commands To return to the normal user shell, insert the command exit You can have several terminals, one of them as root, and the rest as normal user, but you have always to be careful when making changes to the system and read
|
|
|