Switching users and Running Commands as others Flashcards

1
Q

To change user ID or become super user use this command:

A

su [username]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

this su option is used to provide an environment similar to what the user would expect had the user logged in directly.

A

a hypen “ - “

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

this su option specifies a command to be executed

A

-c command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

to find out what user is that you’re working as type:

A

whoami

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

To execute a command as another user, typically the super user, used to install, start, stop, and execute. It is different from the “su” command where you don’t need to know the other user’s password, it will prompt you for yours.

A

sudo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

this sudo command lists all available commands:

A

sudo -l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

this sudo command runs a command as root

A

sudo command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

this sudo command also runs a command as root

A

sudo -u root command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

this sudo command runs a command as user

A

sudo -u user command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

this sudo command switches to the superuser account

A

sudo su

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

this sudo command switches to the superuser account with root’s environment

A

sudo su -

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

this sudo command switches to the username account

A

sudo su - username

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

this sudo command starts a shell prompt

A

sudo -s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

this sudo command also starts a shell prompt

A

sudo -u root -s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

this sudo command starts a shell as user

A

sudo -u user -s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly