From the course: SUSE Linux Enterprise Server Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Delegate privileges with su and sudo

Delegate privileges with su and sudo - Linux Tutorial

From the course: SUSE Linux Enterprise Server Essential Training

Start my 1-month free trial

Delegate privileges with su and sudo

- [Instructor] When we talked about file permissions, we had user, group, and other. Sometimes when we're doing system administration, we're running as root, so we want to act with the permissions of a user, so we may want to switch users, and work ask if we are in that account. So we have a user account with the user name of user. I'm going to switch users to user. And as you can see, my prompt has changed, and it is now logged in as if I was user. If I exit, I go back out to the shell I was in with the permissions I had, which was root. Now, if you do switch user and add a dash, and not only are you going to switch to the user, but you're going to execute the log on scripts, so your environment will be set up the same way as it was if you logged in fresh. So now I can test things out as that user, try different files, execute them, see if I have the permissions, and have the experience that the user would have. But what happens if it's the other way around? What happens if I'm a…

Contents