From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 2 File Access, Storage, and Security

Unlock the full course today

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

Log in and switch users in multiuser targets

Log in and switch users in multiuser targets

From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 2 File Access, Storage, and Security

Start my 1-month free trial

Log in and switch users in multiuser targets

- [Instructor] We have the option to log in as a different user in Linux but there are times where we might want to switch to a different user temporarily. Usually we do this when we went to elevate our privileges to root to run a command or access a resource. There's an easy way of telling who you are currently. For this we can use the who am I command. Type in who am I and hit enter. And it says I'm user1. Who am I very simply prints out which user I'm logged in as. We have another command called log name which at first glance, looks identical to who am I. If we view the man pages for both we may be left confused. Type in log name and hit enter. Let me explain the differences. When we log in as a user, we are that user. We can however use the SU command to effectively switch to a new user. For instance, to switch to root we type in SU space root and hit enter, and then enter a root's password. Notice our prompt now says we're root. If we type in who am I, it says we're root. Now…

Contents