The first file the system reads to set variables is /etc/environment. I would also like to comment that to gain a super user login session, please use sudo -i (or sudo -s) as sudo su - is just silly: its asking sudo to give super user permissions to su so that su can start a login shell for the super user - when sudo can achieve the same result better it by itself. 1 Answer Sorted by: 4 This is probably due to the difference between login and interactive shells. That being said, sudo in itself enforces security by by checking the /etc/sudoers file to make sure the current user is allowed to gain super user permissions,and possibly verifying the current user's password. In the example above, the user account is raven. What's the difference between sudo su - and sudo su - Unix & Linux Stack Exchange What's the difference between sudo su - and sudo su - Ask Question Asked 12 years ago Modified 7 years, 10 months ago Viewed 10k times 24 When I am working on our RHEL machines, I use sudo su - to switch to being root. sudo su - username will do the same, but first ask the system to be elevated to super user mode, after which su will not ask for "username"'s password because a super user is allowed to change into any other user without knowing their password. To enable this feature, simply select su+sudo in the Elevate privileges with section under the credentials/SSH settings as shown in the following screen shot: Under the SSH user name, and SSH password tabs, enter the credentials that do not have sudo privileges.The system will require the password for the user "username" (even if its the same as the current user). The sudo command is controlled by your /etc/sudoers file and can be configured to permit privilege escalation without a password. In this tutorial, learn all about the difference between su and sudo. su someuser -c echo hello world They have slightly different semantics. Because they are similar in syntax and have overlapping functions, many new users are unsure when to use one over the other. su - username - Asks the system to start a new login session for the specified user. Introduction The sudo and su commands belong to the group of commands every Linux user comes across. After installation, for any other administrative. If a system doesn't have sudo installed, it's easy to obtain from the package manager. Usually, the first user is designated an 'administrative' user and thus set up to use sudo. Just repeating both and answers because they are both missing some fine details: The result is that if you use su root in Debian 10, youre missing folders in PATH, such as /sbin and you wont be able to use many commands, such as reboot. Because sudo is granular and more secure than su, more Linux distributions set it as the default superuser command.
0 Comments
Leave a Reply. |