![]() ![]() This article has explained the difference between ‘su -‘ and ‘su root’ commands in Linux. Once you enter the password, it is switched to the root user. Both commands prompt to enter the root user password. In Linux, the “ su –” is utilized to switch to a user account with a login shell session, and the “ su root” switches to the root user account without a login shell. This command is often used to perform administrative tasks as the root user without affecting the current environment.It requires the user to enter the root user’s password to authenticate. Intro Difference between 'sudo' and 'su' command in Linux Bryant Son 598 subscribers Subscribe 6.5K views 2 years ago Linux Watch this video to find out the difference between 'sudo' and 'su'.This command switches the user to the root user account without changing the current environment variables or the current directory.This command is often used to execute commands as the root user.It also changes the current directory to the root user’s home directory.This command switches the user to the root user account and sets the environment variables to those of the root user.The significant differences between the two are: su – Commands The “su -” and “su root” commands in Linux are used to switch to the root user account. Difference Between “su -” and “su root” Commands sudo -i: This allows you to interactively access the root account without direct access using your current password. sudo su: can also be used to switch to any normal or root user account with your current password. This also represents the difference between the su – and su root. su: will allow you to switch to any user account or superuser account with their account password. ![]() The output above shows that the user has been switched to root but the home directory is of the current user. To switch to the root user and run a command with root privileges, use the basic “su -” command: Here are some examples of su – commands in Linux: Example 1: Switch to the Root User Using the “su -” Command It means that it loads the environment of the target user, including the home directory, PATH, and other environment variables. ![]() The “ su –” command is utilized to switch to the root user account and create a login shell session. What is the Difference Between “su -” and “su root” Commands?.To explore that, this post will address the difference between the “su -” and the “su root” as follows: Among the “su” command options, the “su -” and “su root” are used to switch to root user with some distinctive features. When used with the “ –” option or followed by a user name like “ su root”, it allows the user to assume the privileges of the target user. In Linux, the “ su” command is utilized to switch to another user account from the current one. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |