7/14/2023 0 Comments Su vs sudo su![]() ![]() Linpus as distributed by Acer allows any user to run any command as root without a password. Without it, you cannot access things like the ‘service’ command for. When adding the ‘-‘ character to the end of this command, you are also put into the PATH of the superuser. bashrc script will be run before executing the su - root command. I’ve always wondered this but finally got the answer as to why you should use: sudo su. On more mainstream Linux systems, you would usually need to enter your own password to use sudo, and there would often be limitations on just what you could do using sudo as well. sudo su lauches su directly with super user privileges, while sudo bash lauches the shell first and then executes the command with bash -c. But always remember than using root privileges has its dangers from this point of view using sudo is often preferable as it makes you type it every time so you don't forget you're using the root account. Practically, sudo makes you root for one command if you've lots to do as root, then use su. ![]() Again, not likely to be all that useful on the One unless you're doing something odd - or have seriously screwed up your own shell environment (in which case this may not work anyway!). sudo su -l : change to user, but with whatever shell environment the root user would usually have. bashrc and /etc/profile will be started, much like running su (or su root ). Note that this is simply sudo with the command of 'su'. It’s essentially the same as just running su in the shell, save for one crucial difference: instead of telling the system to switch users directly, you’re telling it to run the su command with superuser privileges. ![]() sudo su : if you don't know the root password (not usually an issue on the One), this allows you to run the su command without a password. This requires the root password, but by default on the One this is set to the same password as the user password. Could somebody explain the difference between sudo su - & su - Thank you. I have tried in Google but couldnt get exactly what I need. This means that all the commands you now enter will be run as root, until you either close the console window or log out as root (Ctrl-D, or exit, will log you out as root but leave you logged into the console as yourself). 1 This question already has answers here : What are the differences between 'su', 'sudo -s', 'sudo -i', 'sudo su' (6 answers) Closed 7 years ago. su : change to be the root user in the present console. They all provide ways of running commands as root (or, technically, as any other user - but since the One comes with only "root" and "user" as user accounts, it's not very relevant to the One!). ![]()
0 Comments
Leave a Reply. |