Linked Questions

84
votes
3answers
44k views

su vs sudo -s vs sudo -i vs sudo bash

What is the difference between the following commands: su sudo -s sudo -i sudo bash I know for su I need to know the root password, and for sudo I have to be in the sudoers file, but once executed ...
35
votes
6answers
36k views

Why are PATH variables different when running via sudo and su?

On my fedora VM, when running with my user account I have /usr/local/bin in my path: [justin@justin-fedora12 ~]$ env | grep PATH PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/...
23
votes
3answers
10k views

How is sudo intended to be used?

I've tried configuring sudo before, but I haven't had too much luck with it. How is it different from su -l -c "x"? It seems that via the configuration file, one can make it so a user can only have ...
3
votes
3answers
10k views

How to create root user account in Debian?

I installed Debian OS today and while installation I skipped the option to create root user and chose to use sudo. Now I would like to create root user account. Is there any way to create the root ...
5
votes
2answers
22k views

How to remove root password on Debian?

I'm running Debian in a virtual machine and for convenience I would like to remove the password on root (since it doesn't really matter what happens to this box). Internet hasn't been too helpful on ...
8
votes
6answers
2k views

Negatives/downsides of Ubuntu's no-root sudo setup

By default, Ubuntu does not create a root account that the user can login to. Instead users use sudo when they need to perform actions that require administrative access. Obviously, the people at ...
10
votes
1answer
5k views

What is the difference between 'sudo' and 'su -c'

Is there any difference between using sudo and using su -c? There are situations where one should be used but not the other? I was previously using Ubuntu where sudo appears to be ubiquitous but now ...
5
votes
3answers
2k views

How does the administrator/root/superuser work in Linux?

We were taught Windows when I was in School. I then opted for a Bachelor course in Computer Engineering where we were made to use Linux instead of Windows. They never taught about basics of Linux and ...
3
votes
3answers
5k views

Return status of `cd` is always 0

I am executing following command. cd dirname; echo $? This always return 0 whether of not cd is successful. This is giving me incredible headache. How to check if cd was successful without reading ...
2
votes
3answers
657 views

Can sudo replace su?

There is much duplication of functionality on Linux-based systems, for example these do the same thing: sudo --login --user <user> sudo su - <user> The sudo-only approach looks more ...
1
vote
4answers
1k views

What's the difference between sudo su vs just su?

I see a lot of posts out there that say you type in sudo su to get an interactive prompt with root privileges, and I see equally many posts debating the pros and cons over sudo -i vs sudo su. Here I'...
-1
votes
2answers
747 views

When in debian 8.1 why is the super user run with su not sudo? [closed]

I am curious why the super user command su is run and not super user do (sudo).
2
votes
1answer
581 views

Why can I run `sudo bash` but not `sudo su`?

I am working on standardizing the sudo access in our environment. To begin with, I am understanding the current setup. Currently, we use sudo bash to get into the root shell without typing any ...