Given that root has all privileges, why is root ALL=(ALL) ALL in /etc/sudoers? [duplicate]












29
















This question already has an answer here:




  • Why does the root user need sudo permission?

    3 answers




I looked at this question:
Trying to understand the difference between “modernNeo ALL=(ALL:ALL) ALL” and “modernNeo ALL=(ALL) ALL” in the sudoers file



I still have a question. Since the "root" user has all privileges, why is root ALL=(ALL) ALL in /etc/sudoers on Linux systems?



## Allow root to run any commands anywhere
root ALL=(ALL) ALL


I tried to comment it out, and the root user still had all privileges, it doesn't affect the root user at all. It looks like root ALL=(ALL) ALL is useless.










share|improve this question









New contributor




Bruce Xie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by Jeff Schaller, Braiam, Stephen Kitt, Christopher, Wouter Verhelst yesterday


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
















  • People should remember that sudo is a package. You can actually still install Debian without sudo, and add it later by sudo apt install sudo ... naturally, if sudo is going to wrap around root for non-super users, it would need to define root in its configuration, along with the other users that contain the same privilege.

    – oemb1905
    yesterday






  • 1





    And ... on freeBSD, the default installation does not even contain sudo. Sudo stands for "su" and "do" commands, or switch user and to do ... it was added early on to stop harm that could happen from always being the root user, as I understand it. But it is not required at all ... fyi

    – oemb1905
    yesterday


















29
















This question already has an answer here:




  • Why does the root user need sudo permission?

    3 answers




I looked at this question:
Trying to understand the difference between “modernNeo ALL=(ALL:ALL) ALL” and “modernNeo ALL=(ALL) ALL” in the sudoers file



I still have a question. Since the "root" user has all privileges, why is root ALL=(ALL) ALL in /etc/sudoers on Linux systems?



## Allow root to run any commands anywhere
root ALL=(ALL) ALL


I tried to comment it out, and the root user still had all privileges, it doesn't affect the root user at all. It looks like root ALL=(ALL) ALL is useless.










share|improve this question









New contributor




Bruce Xie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by Jeff Schaller, Braiam, Stephen Kitt, Christopher, Wouter Verhelst yesterday


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
















  • People should remember that sudo is a package. You can actually still install Debian without sudo, and add it later by sudo apt install sudo ... naturally, if sudo is going to wrap around root for non-super users, it would need to define root in its configuration, along with the other users that contain the same privilege.

    – oemb1905
    yesterday






  • 1





    And ... on freeBSD, the default installation does not even contain sudo. Sudo stands for "su" and "do" commands, or switch user and to do ... it was added early on to stop harm that could happen from always being the root user, as I understand it. But it is not required at all ... fyi

    – oemb1905
    yesterday
















29












29








29


3







This question already has an answer here:




  • Why does the root user need sudo permission?

    3 answers




I looked at this question:
Trying to understand the difference between “modernNeo ALL=(ALL:ALL) ALL” and “modernNeo ALL=(ALL) ALL” in the sudoers file



I still have a question. Since the "root" user has all privileges, why is root ALL=(ALL) ALL in /etc/sudoers on Linux systems?



## Allow root to run any commands anywhere
root ALL=(ALL) ALL


I tried to comment it out, and the root user still had all privileges, it doesn't affect the root user at all. It looks like root ALL=(ALL) ALL is useless.










share|improve this question









New contributor




Bruce Xie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













This question already has an answer here:




  • Why does the root user need sudo permission?

    3 answers




I looked at this question:
Trying to understand the difference between “modernNeo ALL=(ALL:ALL) ALL” and “modernNeo ALL=(ALL) ALL” in the sudoers file



I still have a question. Since the "root" user has all privileges, why is root ALL=(ALL) ALL in /etc/sudoers on Linux systems?



## Allow root to run any commands anywhere
root ALL=(ALL) ALL


I tried to comment it out, and the root user still had all privileges, it doesn't affect the root user at all. It looks like root ALL=(ALL) ALL is useless.





This question already has an answer here:




  • Why does the root user need sudo permission?

    3 answers








sudo root






share|improve this question









New contributor




Bruce Xie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Bruce Xie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 2 days ago









Jeff Schaller

39.6k1054126




39.6k1054126






New contributor




Bruce Xie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 days ago









Bruce XieBruce Xie

14614




14614




New contributor




Bruce Xie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Bruce Xie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Bruce Xie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




marked as duplicate by Jeff Schaller, Braiam, Stephen Kitt, Christopher, Wouter Verhelst yesterday


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Jeff Schaller, Braiam, Stephen Kitt, Christopher, Wouter Verhelst yesterday


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • People should remember that sudo is a package. You can actually still install Debian without sudo, and add it later by sudo apt install sudo ... naturally, if sudo is going to wrap around root for non-super users, it would need to define root in its configuration, along with the other users that contain the same privilege.

    – oemb1905
    yesterday






  • 1





    And ... on freeBSD, the default installation does not even contain sudo. Sudo stands for "su" and "do" commands, or switch user and to do ... it was added early on to stop harm that could happen from always being the root user, as I understand it. But it is not required at all ... fyi

    – oemb1905
    yesterday





















  • People should remember that sudo is a package. You can actually still install Debian without sudo, and add it later by sudo apt install sudo ... naturally, if sudo is going to wrap around root for non-super users, it would need to define root in its configuration, along with the other users that contain the same privilege.

    – oemb1905
    yesterday






  • 1





    And ... on freeBSD, the default installation does not even contain sudo. Sudo stands for "su" and "do" commands, or switch user and to do ... it was added early on to stop harm that could happen from always being the root user, as I understand it. But it is not required at all ... fyi

    – oemb1905
    yesterday



















People should remember that sudo is a package. You can actually still install Debian without sudo, and add it later by sudo apt install sudo ... naturally, if sudo is going to wrap around root for non-super users, it would need to define root in its configuration, along with the other users that contain the same privilege.

– oemb1905
yesterday





People should remember that sudo is a package. You can actually still install Debian without sudo, and add it later by sudo apt install sudo ... naturally, if sudo is going to wrap around root for non-super users, it would need to define root in its configuration, along with the other users that contain the same privilege.

– oemb1905
yesterday




1




1





And ... on freeBSD, the default installation does not even contain sudo. Sudo stands for "su" and "do" commands, or switch user and to do ... it was added early on to stop harm that could happen from always being the root user, as I understand it. But it is not required at all ... fyi

– oemb1905
yesterday







And ... on freeBSD, the default installation does not even contain sudo. Sudo stands for "su" and "do" commands, or switch user and to do ... it was added early on to stop harm that could happen from always being the root user, as I understand it. But it is not required at all ... fyi

– oemb1905
yesterday












1 Answer
1






active

oldest

votes


















44














That entry ensures that root can run sudo. If you comment it out,



sudo ls


run as root will fail.



It’s a convenience: it means users can run sudo commands without thinking about things too much, i.e. they’ll work the same way whether they’re running as a sudo-enabled user or root (whether that’s a good idea is another question). It also means that scripts can use sudo to request root privileges, and still work without issue when they’re run as root directly.






share|improve this answer


























  • looks like that, I got it, thank you!

    – Bruce Xie
    2 days ago






  • 10





    It also allows root to become another user which is handy if you need to debug something or want to run something with limited privileges.

    – eckes
    2 days ago






  • 5





    @eckes indeed; and root can do that using a variety of tools, without a password (su for example).

    – Stephen Kitt
    2 days ago






  • 5





    @StephenKitt sudo also sanitizes the environment when you switch users with it, which is kind of important if you're debugging things.

    – Austin Hemmelgarn
    2 days ago


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









44














That entry ensures that root can run sudo. If you comment it out,



sudo ls


run as root will fail.



It’s a convenience: it means users can run sudo commands without thinking about things too much, i.e. they’ll work the same way whether they’re running as a sudo-enabled user or root (whether that’s a good idea is another question). It also means that scripts can use sudo to request root privileges, and still work without issue when they’re run as root directly.






share|improve this answer


























  • looks like that, I got it, thank you!

    – Bruce Xie
    2 days ago






  • 10





    It also allows root to become another user which is handy if you need to debug something or want to run something with limited privileges.

    – eckes
    2 days ago






  • 5





    @eckes indeed; and root can do that using a variety of tools, without a password (su for example).

    – Stephen Kitt
    2 days ago






  • 5





    @StephenKitt sudo also sanitizes the environment when you switch users with it, which is kind of important if you're debugging things.

    – Austin Hemmelgarn
    2 days ago
















44














That entry ensures that root can run sudo. If you comment it out,



sudo ls


run as root will fail.



It’s a convenience: it means users can run sudo commands without thinking about things too much, i.e. they’ll work the same way whether they’re running as a sudo-enabled user or root (whether that’s a good idea is another question). It also means that scripts can use sudo to request root privileges, and still work without issue when they’re run as root directly.






share|improve this answer


























  • looks like that, I got it, thank you!

    – Bruce Xie
    2 days ago






  • 10





    It also allows root to become another user which is handy if you need to debug something or want to run something with limited privileges.

    – eckes
    2 days ago






  • 5





    @eckes indeed; and root can do that using a variety of tools, without a password (su for example).

    – Stephen Kitt
    2 days ago






  • 5





    @StephenKitt sudo also sanitizes the environment when you switch users with it, which is kind of important if you're debugging things.

    – Austin Hemmelgarn
    2 days ago














44












44








44







That entry ensures that root can run sudo. If you comment it out,



sudo ls


run as root will fail.



It’s a convenience: it means users can run sudo commands without thinking about things too much, i.e. they’ll work the same way whether they’re running as a sudo-enabled user or root (whether that’s a good idea is another question). It also means that scripts can use sudo to request root privileges, and still work without issue when they’re run as root directly.






share|improve this answer















That entry ensures that root can run sudo. If you comment it out,



sudo ls


run as root will fail.



It’s a convenience: it means users can run sudo commands without thinking about things too much, i.e. they’ll work the same way whether they’re running as a sudo-enabled user or root (whether that’s a good idea is another question). It also means that scripts can use sudo to request root privileges, and still work without issue when they’re run as root directly.







share|improve this answer














share|improve this answer



share|improve this answer








edited 2 days ago

























answered 2 days ago









Stephen KittStephen Kitt

167k24376454




167k24376454













  • looks like that, I got it, thank you!

    – Bruce Xie
    2 days ago






  • 10





    It also allows root to become another user which is handy if you need to debug something or want to run something with limited privileges.

    – eckes
    2 days ago






  • 5





    @eckes indeed; and root can do that using a variety of tools, without a password (su for example).

    – Stephen Kitt
    2 days ago






  • 5





    @StephenKitt sudo also sanitizes the environment when you switch users with it, which is kind of important if you're debugging things.

    – Austin Hemmelgarn
    2 days ago



















  • looks like that, I got it, thank you!

    – Bruce Xie
    2 days ago






  • 10





    It also allows root to become another user which is handy if you need to debug something or want to run something with limited privileges.

    – eckes
    2 days ago






  • 5





    @eckes indeed; and root can do that using a variety of tools, without a password (su for example).

    – Stephen Kitt
    2 days ago






  • 5





    @StephenKitt sudo also sanitizes the environment when you switch users with it, which is kind of important if you're debugging things.

    – Austin Hemmelgarn
    2 days ago

















looks like that, I got it, thank you!

– Bruce Xie
2 days ago





looks like that, I got it, thank you!

– Bruce Xie
2 days ago




10




10





It also allows root to become another user which is handy if you need to debug something or want to run something with limited privileges.

– eckes
2 days ago





It also allows root to become another user which is handy if you need to debug something or want to run something with limited privileges.

– eckes
2 days ago




5




5





@eckes indeed; and root can do that using a variety of tools, without a password (su for example).

– Stephen Kitt
2 days ago





@eckes indeed; and root can do that using a variety of tools, without a password (su for example).

– Stephen Kitt
2 days ago




5




5





@StephenKitt sudo also sanitizes the environment when you switch users with it, which is kind of important if you're debugging things.

– Austin Hemmelgarn
2 days ago





@StephenKitt sudo also sanitizes the environment when you switch users with it, which is kind of important if you're debugging things.

– Austin Hemmelgarn
2 days ago



Popular posts from this blog

"Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

Alcedinidae

Origin of the phrase “under your belt”?