![]() 1) switches from the current directory to the home directory of the new user (e.g., to /root in the case of the root user) by logging in as. Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen. The difference between '-' and 'no hyphen' is that the latter keeps your existing environment (variables, etc) the former creates a new environment (with the settings of the actual user, not your own). 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. Just use those commands with caution, so you don’t wind up wreaking havoc on your Linux desktop or server. However, if there’s a command you must run, and it fails with a minimal sudo command, either sudo – or sudo su – will always work. Most often, you’ll only have to run basic sudo or su commands. ![]() If you issue the command sudo su, you switch to the root user without resetting the environment variables, so you have the root user privileges, but not the environment. bashrc files by root, but only if the user running the command is defined in the /etc/sudoers file, effectively becoming the root user, even if the root user is disabled, such as it is in Ubuntu. Sudo runs a single command with root privileges it doesnt switch to the. If you run the command sudo su – you will switch to the root user which will then execute all /etc/profile. Su switches you to the root user account and requires the root accounts password. If you use just sudo, you execute a command with admin privileges. SEE: Linux file and directory management commands (TechRepublic Premium) ![]() Execute the command su – and you invoke a login shell after switching the user, which resets most environment variables, providing a clean base. If you issue the command su, you switch your user to root, which then executes only the. There are different ways to use sudo and su. ![]() The top 6 enterprise VPN solutions to use in 2023ĮY survey: Tech leaders to invest in AI, 5G, cybersecurity, big data, metaverseĮlectronic data retention policy (TechRepublic Premium) Google offers certificate in cybersecurity, no dorm room required Even though most every Linux distribution uses sudo, some of them (such as Fedora and openSUSE) allow you to su (switch user) to the super user account–otherwise known as root. Sudo stands for “super user do” and allows standard users to take admin-level actions, such as installing software. If you’re a new Linux admin, you probably at least know about sudo. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |