Why doesn't root need the password to run “sudo” even when “NOPASSWD:ALL” isn't written in /etc/sudoers [duplicate] The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsWhy can `root` run any command as any user without providing password?sudo no password breaks other sudo -u usesExecute shell script from php, as root user?How do I get simple scripts which seem to need root priveliges to run via the www-data user?Is it safe to disable password for a user, if it only uses SSH key login?Use current user environment variable in sudoers fileParallels on Mac - can no longer sudo within UbuntuWhat does “ALL ALL=(ALL) ALL” mean in sudoers?Why do I still need to run shutdown as sudo after this?Checking sudoers without root?IPTABLES and sudoers file issue

Did God make two great lights or did He make the great light two?

Semisimplicity of the category of coherent sheaves?

Relations between two reciprocal partial derivatives?

ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?

What can I do if neighbor is blocking my solar panels intentionally?

How to colour the US map with Yellow, Green, Red and Blue to minimize the number of states with the colour of Green

How long does the line of fire that you can create as an action using the Investiture of Flame spell last?

How can I define good in a religion that claims no moral authority?

How does ice melt when immersed in water?

Difference between "generating set" and free product?

Why does the Event Horizon Telescope (EHT) not include telescopes from Africa, Asia or Australia?

Slither Like a Snake

The variadic template constructor of my class cannot modify my class members, why is that so?

Derivation tree not rendering

Working through the single responsibility principle (SRP) in Python when calls are expensive

Format single node in tikzcd

Keeping a retro style to sci-fi spaceships?

Can the prologue be the backstory of your main character?

"... to apply for a visa" or "... and applied for a visa"?

Wolves and sheep

Didn't get enough time to take a Coding Test - what to do now?

What is special about square numbers here?

Take groceries in checked luggage

When did F become S in typeography, and why?



Why doesn't root need the password to run “sudo” even when “NOPASSWD:ALL” isn't written in /etc/sudoers [duplicate]



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election ResultsWhy can `root` run any command as any user without providing password?sudo no password breaks other sudo -u usesExecute shell script from php, as root user?How do I get simple scripts which seem to need root priveliges to run via the www-data user?Is it safe to disable password for a user, if it only uses SSH key login?Use current user environment variable in sudoers fileParallels on Mac - can no longer sudo within UbuntuWhat does “ALL ALL=(ALL) ALL” mean in sudoers?Why do I still need to run shutdown as sudo after this?Checking sudoers without root?IPTABLES and sudoers file issue



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








6
















This question already has an answer here:



  • Why can `root` run any command as any user without providing password?

    2 answers



In /etc/sudoers, there is always:



root ALL=(ALL:ALL) ALL


However, the root user (with UID 0) doesn't need to enter password when they run sudo command.



For other users, a password is required unless their entry contains NOPASSWD or a previous authentication hasn't timed out:



user ALL=(ALL:ALL) NOPASSWD:ALL
^^^^^^^^









share|improve this question















marked as duplicate by muru, roaima, msp9011, nwildner, Anthony Geoghegan Mar 25 at 15:01


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.


















  • This is a bit weird actually. Even though you'd usually use sudo to run commands as UID 0, and root is already UID 0 and there's nothing to gain by stopping them, sudo still requires the config line for root to be there. Without it, it tells even root to bugger off.

    – ilkkachu
    Mar 25 at 10:37











  • Cause it is root. What would you gain running sudo as root? "Beyond Root"? "Who watch the Watchmen?"

    – nwildner
    Mar 25 at 14:28

















6
















This question already has an answer here:



  • Why can `root` run any command as any user without providing password?

    2 answers



In /etc/sudoers, there is always:



root ALL=(ALL:ALL) ALL


However, the root user (with UID 0) doesn't need to enter password when they run sudo command.



For other users, a password is required unless their entry contains NOPASSWD or a previous authentication hasn't timed out:



user ALL=(ALL:ALL) NOPASSWD:ALL
^^^^^^^^









share|improve this question















marked as duplicate by muru, roaima, msp9011, nwildner, Anthony Geoghegan Mar 25 at 15:01


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.


















  • This is a bit weird actually. Even though you'd usually use sudo to run commands as UID 0, and root is already UID 0 and there's nothing to gain by stopping them, sudo still requires the config line for root to be there. Without it, it tells even root to bugger off.

    – ilkkachu
    Mar 25 at 10:37











  • Cause it is root. What would you gain running sudo as root? "Beyond Root"? "Who watch the Watchmen?"

    – nwildner
    Mar 25 at 14:28













6












6








6


1







This question already has an answer here:



  • Why can `root` run any command as any user without providing password?

    2 answers



In /etc/sudoers, there is always:



root ALL=(ALL:ALL) ALL


However, the root user (with UID 0) doesn't need to enter password when they run sudo command.



For other users, a password is required unless their entry contains NOPASSWD or a previous authentication hasn't timed out:



user ALL=(ALL:ALL) NOPASSWD:ALL
^^^^^^^^









share|improve this question

















This question already has an answer here:



  • Why can `root` run any command as any user without providing password?

    2 answers



In /etc/sudoers, there is always:



root ALL=(ALL:ALL) ALL


However, the root user (with UID 0) doesn't need to enter password when they run sudo command.



For other users, a password is required unless their entry contains NOPASSWD or a previous authentication hasn't timed out:



user ALL=(ALL:ALL) NOPASSWD:ALL
^^^^^^^^




This question already has an answer here:



  • Why can `root` run any command as any user without providing password?

    2 answers







linux sudo root






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 7:14







iBug

















asked Mar 25 at 7:09









iBugiBug

1,0181032




1,0181032




marked as duplicate by muru, roaima, msp9011, nwildner, Anthony Geoghegan Mar 25 at 15:01


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 muru, roaima, msp9011, nwildner, Anthony Geoghegan Mar 25 at 15:01


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.














  • This is a bit weird actually. Even though you'd usually use sudo to run commands as UID 0, and root is already UID 0 and there's nothing to gain by stopping them, sudo still requires the config line for root to be there. Without it, it tells even root to bugger off.

    – ilkkachu
    Mar 25 at 10:37











  • Cause it is root. What would you gain running sudo as root? "Beyond Root"? "Who watch the Watchmen?"

    – nwildner
    Mar 25 at 14:28

















  • This is a bit weird actually. Even though you'd usually use sudo to run commands as UID 0, and root is already UID 0 and there's nothing to gain by stopping them, sudo still requires the config line for root to be there. Without it, it tells even root to bugger off.

    – ilkkachu
    Mar 25 at 10:37











  • Cause it is root. What would you gain running sudo as root? "Beyond Root"? "Who watch the Watchmen?"

    – nwildner
    Mar 25 at 14:28
















This is a bit weird actually. Even though you'd usually use sudo to run commands as UID 0, and root is already UID 0 and there's nothing to gain by stopping them, sudo still requires the config line for root to be there. Without it, it tells even root to bugger off.

– ilkkachu
Mar 25 at 10:37





This is a bit weird actually. Even though you'd usually use sudo to run commands as UID 0, and root is already UID 0 and there's nothing to gain by stopping them, sudo still requires the config line for root to be there. Without it, it tells even root to bugger off.

– ilkkachu
Mar 25 at 10:37













Cause it is root. What would you gain running sudo as root? "Beyond Root"? "Who watch the Watchmen?"

– nwildner
Mar 25 at 14:28





Cause it is root. What would you gain running sudo as root? "Beyond Root"? "Who watch the Watchmen?"

– nwildner
Mar 25 at 14:28










2 Answers
2






active

oldest

votes


















6














sudo allows users to execute commands as UID 0 (or other users) based on how it’s configured. There is no need to ask root for a password to run a command as UID 0, because it already is UID 0.



Furthermore, root can also su to anyone it’d like, so there’s no need to prompt for a password when executing sudo -u user as UID 0.



Note: I do believe there is a PAM setting that will even require root to provide a password for the target user when using su.






share|improve this answer






























    3














    While this is an interesting inconsistency. It would be pointless in stopping root, as root has capabilities CAP_SETUID and CAP_SETGID, so does not need sudo. It can do what ever it want.



    If sudo is checking root, and not these capabilities, then there may be a latent-bug: root with no capabilities could escalate (I don't know I have not looked at the code, or tested).






    share|improve this answer





























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      6














      sudo allows users to execute commands as UID 0 (or other users) based on how it’s configured. There is no need to ask root for a password to run a command as UID 0, because it already is UID 0.



      Furthermore, root can also su to anyone it’d like, so there’s no need to prompt for a password when executing sudo -u user as UID 0.



      Note: I do believe there is a PAM setting that will even require root to provide a password for the target user when using su.






      share|improve this answer



























        6














        sudo allows users to execute commands as UID 0 (or other users) based on how it’s configured. There is no need to ask root for a password to run a command as UID 0, because it already is UID 0.



        Furthermore, root can also su to anyone it’d like, so there’s no need to prompt for a password when executing sudo -u user as UID 0.



        Note: I do believe there is a PAM setting that will even require root to provide a password for the target user when using su.






        share|improve this answer

























          6












          6








          6







          sudo allows users to execute commands as UID 0 (or other users) based on how it’s configured. There is no need to ask root for a password to run a command as UID 0, because it already is UID 0.



          Furthermore, root can also su to anyone it’d like, so there’s no need to prompt for a password when executing sudo -u user as UID 0.



          Note: I do believe there is a PAM setting that will even require root to provide a password for the target user when using su.






          share|improve this answer













          sudo allows users to execute commands as UID 0 (or other users) based on how it’s configured. There is no need to ask root for a password to run a command as UID 0, because it already is UID 0.



          Furthermore, root can also su to anyone it’d like, so there’s no need to prompt for a password when executing sudo -u user as UID 0.



          Note: I do believe there is a PAM setting that will even require root to provide a password for the target user when using su.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 25 at 7:24









          PeschkePeschke

          2,841926




          2,841926























              3














              While this is an interesting inconsistency. It would be pointless in stopping root, as root has capabilities CAP_SETUID and CAP_SETGID, so does not need sudo. It can do what ever it want.



              If sudo is checking root, and not these capabilities, then there may be a latent-bug: root with no capabilities could escalate (I don't know I have not looked at the code, or tested).






              share|improve this answer



























                3














                While this is an interesting inconsistency. It would be pointless in stopping root, as root has capabilities CAP_SETUID and CAP_SETGID, so does not need sudo. It can do what ever it want.



                If sudo is checking root, and not these capabilities, then there may be a latent-bug: root with no capabilities could escalate (I don't know I have not looked at the code, or tested).






                share|improve this answer

























                  3












                  3








                  3







                  While this is an interesting inconsistency. It would be pointless in stopping root, as root has capabilities CAP_SETUID and CAP_SETGID, so does not need sudo. It can do what ever it want.



                  If sudo is checking root, and not these capabilities, then there may be a latent-bug: root with no capabilities could escalate (I don't know I have not looked at the code, or tested).






                  share|improve this answer













                  While this is an interesting inconsistency. It would be pointless in stopping root, as root has capabilities CAP_SETUID and CAP_SETGID, so does not need sudo. It can do what ever it want.



                  If sudo is checking root, and not these capabilities, then there may be a latent-bug: root with no capabilities could escalate (I don't know I have not looked at the code, or tested).







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 25 at 8:10









                  ctrl-alt-delorctrl-alt-delor

                  12.5k52662




                  12.5k52662













                      Popular posts from this blog

                      Solar Wings Breeze Design and development Specifications (Breeze) References Navigation menu1368-485X"Hang glider: Breeze (Solar Wings)"e

                      Kathakali Contents Etymology and nomenclature History Repertoire Songs and musical instruments Traditional plays Styles: Sampradayam Training centers and awards Relationship to other dance forms See also Notes References External links Navigation menueThe Illustrated Encyclopedia of Hinduism: A-MSouth Asian Folklore: An EncyclopediaRoutledge International Encyclopedia of Women: Global Women's Issues and KnowledgeKathakali Dance-drama: Where Gods and Demons Come to PlayKathakali Dance-drama: Where Gods and Demons Come to PlayKathakali Dance-drama: Where Gods and Demons Come to Play10.1353/atj.2005.0004The Illustrated Encyclopedia of Hinduism: A-MEncyclopedia of HinduismKathakali Dance-drama: Where Gods and Demons Come to PlaySonic Liturgy: Ritual and Music in Hindu Tradition"The Mirror of Gesture"Kathakali Dance-drama: Where Gods and Demons Come to Play"Kathakali"Indian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceMedieval Indian Literature: An AnthologyThe Oxford Companion to Indian TheatreSouth Asian Folklore: An Encyclopedia : Afghanistan, Bangladesh, India, Nepal, Pakistan, Sri LankaThe Rise of Performance Studies: Rethinking Richard Schechner's Broad SpectrumIndian Theatre: Traditions of PerformanceModern Asian Theatre and Performance 1900-2000Critical Theory and PerformanceBetween Theater and AnthropologyKathakali603847011Indian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceBetween Theater and AnthropologyBetween Theater and AnthropologyNambeesan Smaraka AwardsArchivedThe Cambridge Guide to TheatreRoutledge International Encyclopedia of Women: Global Women's Issues and KnowledgeThe Garland Encyclopedia of World Music: South Asia : the Indian subcontinentThe Ethos of Noh: Actors and Their Art10.2307/1145740By Means of Performance: Intercultural Studies of Theatre and Ritual10.1017/s204912550000100xReconceiving the Renaissance: A Critical ReaderPerformance TheoryListening to Theatre: The Aural Dimension of Beijing Opera10.2307/1146013Kathakali: The Art of the Non-WorldlyOn KathakaliKathakali, the dance theatreThe Kathakali Complex: Performance & StructureKathakali Dance-Drama: Where Gods and Demons Come to Play10.1093/obo/9780195399318-0071Drama and Ritual of Early Hinduism"In the Shadow of Hollywood Orientalism: Authentic East Indian Dancing"10.1080/08949460490274013Sanskrit Play Production in Ancient IndiaIndian Music: History and StructureBharata, the Nāṭyaśāstra233639306Table of Contents2238067286469807Dance In Indian Painting10.2307/32047833204783Kathakali Dance-Theatre: A Visual Narrative of Sacred Indian MimeIndian Classical Dance: The Renaissance and BeyondKathakali: an indigenous art-form of Keralaeee

                      Method to test if a number is a perfect power? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Detecting perfect squares faster than by extracting square rooteffective way to get the integer sequence A181392 from oeisA rarely mentioned fact about perfect powersHow many numbers such $n$ are there that $n<100,lfloorsqrtn rfloor mid n$Check perfect squareness by modulo division against multiple basesFor what pair of integers $(a,b)$ is $3^a + 7^b$ a perfect square.Do there exist any positive integers $n$ such that $lfloore^nrfloor$ is a perfect power? What is the probability that one exists?finding perfect power factors of an integerProve that the sequence contains a perfect square for any natural number $m $ in the domain of $f$ .Counting Perfect Powers