Linked Questions

17
votes
3answers
18k views

Difference between sudo -i and sudo su [duplicate]

I was wondering what the difference is between sudo -i and sudo su?
5
votes
2answers
1k views

Why doesn't 'sudo bash && cd desktop' cd in to the desktop folder? [duplicate]

I have a folder with chmod 000 permissions on it with a lot of different stuff in, the way I get in is a start bash in sudo by running sudo bash. Why can't I do &&? I want to cd into the ...
2
votes
1answer
26k views

What is the difference between su username and sudo su - username? [duplicate]

I see both does the same thing and both end me up in the same directory.So is it really the same or there is a difference? Also doing su and su - makes me root user in both the cases.So how is it ...
7
votes
1answer
14k views

Difference between sudo su - user and sudo -iu user [duplicate]

I was wondering if there were any difference (in environment ?) between doing sudo su - user and sudo -iu user From what I know: By using sudo su - user I open a new shell as user, and the ...
1
vote
1answer
419 views

Something confusing about “su -” and “su” [duplicate]

I am studying the Linux command line. But the book which I'm reading says that su -l(-) username is starting a new shell session and loading the environment of the user I want to change to, but su ...
0
votes
1answer
44 views

sudo -i and sudo -s on APPLE [duplicate]

I have a question on sudo -i and sudo -s on APPLE. When I use sudo -i, it will change to "root" this user. I use sudo -s and this has the similar situation but there is a "bash-3.2#" on my terminal. I ...
120
votes
8answers
28k views

Which is the safest way to get root privileges: sudo, su or login?

I would like to have the root account in safety even if my unprivileged user is compromised. On Ubuntu you can only use sudo for "security reasons" by default. However I am not sure it is any safer ...
64
votes
12answers
26k views

Why do I have to use sudo for almost everything?

If I understand the Linux philosophy correctly, sudo should be used sparingly, and most operations should be performed as an under-privileged user. But that doesn't seem to make sense, since I'm ...
3
votes
1answer
762 views

Difference between sudo -s and sudo su -

It might be a duplicate and I'm pretty sure I already show an answer to that somewhere, but I wondered what are the difference in term of right and variable and other stuff between sudo -s and sudo su ...
2
votes
1answer
1k views

sudo -su vs sudo su -

On RHEL 7.5, I created a non-root user and would like to switch from one non-root-user to another non-root-user, without password. First tried, sudo -u user1, command syntax error then tried, sudo ...
0
votes
1answer
78 views

Permissions for new user

I have created a user in my Centos VPS. But with the new user I can not create, modify files in any folder (for example /var/www/ or /etc/nginx/conf.d/), even though I have added the new user to the ...
1
vote
0answers
52 views

Keyboard doesn't work with su

I try to open an app in OSX — let's say Notes for instance, I use two commands in terminal to switch to other user: sudo -u user /Applications/Notes.app/Contents/MacOS/Notes this opens Notes as user,...
0
votes
0answers
22 views

what is the difference between `sudo su - <username>` and `sudo -iu <username>` [duplicate]

they both log you in as <username> and that the first involves using running su as root while the second does not involve the su command but I am wondering what are the differences to both? is ...