Sudo command hangs

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Every time I try to execute sudo su - or any other sudo command for this matter my server hangs, sometimes it take 10 mins to respond and sometimes it never does.



I checked /etc/hosts file which was configured correctly. I also checked /etc/resolv.conf file which looked good as well.
any suggestions?



I am running redhat 6.9







share|improve this question






















  • So,  do you have any way of becoming root?
    – G-Man
    Oct 28 '17 at 6:09










  • Yes.. Sometimes it allows me to become root
    – Ahmed Soliman
    Oct 28 '17 at 6:10










  • Have you tried running sudo after you’re already root?  Does it still hang then?  If so, you might try running strace (or some similar program) on it.
    – G-Man
    Oct 28 '17 at 6:15







  • 1




    When does it hang -- before asking for the password or after? (Also, strace sudo -i or so might be your friend, even if its output is daunting, because you can see what it's trying to do when it hangs.)
    – Ulrich Schwarz
    Oct 28 '17 at 6:16






  • 1




    @GAD3R I think that resolved my issue
    – Ahmed Soliman
    Oct 28 '17 at 18:00














up vote
0
down vote

favorite












Every time I try to execute sudo su - or any other sudo command for this matter my server hangs, sometimes it take 10 mins to respond and sometimes it never does.



I checked /etc/hosts file which was configured correctly. I also checked /etc/resolv.conf file which looked good as well.
any suggestions?



I am running redhat 6.9







share|improve this question






















  • So,  do you have any way of becoming root?
    – G-Man
    Oct 28 '17 at 6:09










  • Yes.. Sometimes it allows me to become root
    – Ahmed Soliman
    Oct 28 '17 at 6:10










  • Have you tried running sudo after you’re already root?  Does it still hang then?  If so, you might try running strace (or some similar program) on it.
    – G-Man
    Oct 28 '17 at 6:15







  • 1




    When does it hang -- before asking for the password or after? (Also, strace sudo -i or so might be your friend, even if its output is daunting, because you can see what it's trying to do when it hangs.)
    – Ulrich Schwarz
    Oct 28 '17 at 6:16






  • 1




    @GAD3R I think that resolved my issue
    – Ahmed Soliman
    Oct 28 '17 at 18:00












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Every time I try to execute sudo su - or any other sudo command for this matter my server hangs, sometimes it take 10 mins to respond and sometimes it never does.



I checked /etc/hosts file which was configured correctly. I also checked /etc/resolv.conf file which looked good as well.
any suggestions?



I am running redhat 6.9







share|improve this question














Every time I try to execute sudo su - or any other sudo command for this matter my server hangs, sometimes it take 10 mins to respond and sometimes it never does.



I checked /etc/hosts file which was configured correctly. I also checked /etc/resolv.conf file which looked good as well.
any suggestions?



I am running redhat 6.9









share|improve this question













share|improve this question




share|improve this question








edited Oct 29 '17 at 21:38









guntbert

1,0011917




1,0011917










asked Oct 28 '17 at 5:59









Ahmed Soliman

12




12











  • So,  do you have any way of becoming root?
    – G-Man
    Oct 28 '17 at 6:09










  • Yes.. Sometimes it allows me to become root
    – Ahmed Soliman
    Oct 28 '17 at 6:10










  • Have you tried running sudo after you’re already root?  Does it still hang then?  If so, you might try running strace (or some similar program) on it.
    – G-Man
    Oct 28 '17 at 6:15







  • 1




    When does it hang -- before asking for the password or after? (Also, strace sudo -i or so might be your friend, even if its output is daunting, because you can see what it's trying to do when it hangs.)
    – Ulrich Schwarz
    Oct 28 '17 at 6:16






  • 1




    @GAD3R I think that resolved my issue
    – Ahmed Soliman
    Oct 28 '17 at 18:00
















  • So,  do you have any way of becoming root?
    – G-Man
    Oct 28 '17 at 6:09










  • Yes.. Sometimes it allows me to become root
    – Ahmed Soliman
    Oct 28 '17 at 6:10










  • Have you tried running sudo after you’re already root?  Does it still hang then?  If so, you might try running strace (or some similar program) on it.
    – G-Man
    Oct 28 '17 at 6:15







  • 1




    When does it hang -- before asking for the password or after? (Also, strace sudo -i or so might be your friend, even if its output is daunting, because you can see what it's trying to do when it hangs.)
    – Ulrich Schwarz
    Oct 28 '17 at 6:16






  • 1




    @GAD3R I think that resolved my issue
    – Ahmed Soliman
    Oct 28 '17 at 18:00















So,  do you have any way of becoming root?
– G-Man
Oct 28 '17 at 6:09




So,  do you have any way of becoming root?
– G-Man
Oct 28 '17 at 6:09












Yes.. Sometimes it allows me to become root
– Ahmed Soliman
Oct 28 '17 at 6:10




Yes.. Sometimes it allows me to become root
– Ahmed Soliman
Oct 28 '17 at 6:10












Have you tried running sudo after you’re already root?  Does it still hang then?  If so, you might try running strace (or some similar program) on it.
– G-Man
Oct 28 '17 at 6:15





Have you tried running sudo after you’re already root?  Does it still hang then?  If so, you might try running strace (or some similar program) on it.
– G-Man
Oct 28 '17 at 6:15





1




1




When does it hang -- before asking for the password or after? (Also, strace sudo -i or so might be your friend, even if its output is daunting, because you can see what it's trying to do when it hangs.)
– Ulrich Schwarz
Oct 28 '17 at 6:16




When does it hang -- before asking for the password or after? (Also, strace sudo -i or so might be your friend, even if its output is daunting, because you can see what it's trying to do when it hangs.)
– Ulrich Schwarz
Oct 28 '17 at 6:16




1




1




@GAD3R I think that resolved my issue
– Ahmed Soliman
Oct 28 '17 at 18:00




@GAD3R I think that resolved my issue
– Ahmed Soliman
Oct 28 '17 at 18:00










2 Answers
2






active

oldest

votes

















up vote
2
down vote













Had the same problem on Ubuntu 16.04 on a newly created openstack remote vm. sudo su hanged for many seconds, maybe up to a minute, before it either worked or not. When it worked it could be made quick and reliable by running this once as root:



echo 127.0.0.1 localhost $(hostname) >> /etc/hosts





share|improve this answer



























    up vote
    0
    down vote













    The problem can reproduced when the hostname is changed , edit your /etc/hosts by adding the output of echo $HOSTNAME after 127.0.0.1:



    127.0.0.1 hostname





    share|improve this answer




















    • I configured it correctly, the issue was fixed but now its back again for no reason. Not sure what the issue is still :(
      – Ahmed Soliman
      Oct 28 '17 at 21:29










    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f401008%2fsudo-command-hangs%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    Had the same problem on Ubuntu 16.04 on a newly created openstack remote vm. sudo su hanged for many seconds, maybe up to a minute, before it either worked or not. When it worked it could be made quick and reliable by running this once as root:



    echo 127.0.0.1 localhost $(hostname) >> /etc/hosts





    share|improve this answer
























      up vote
      2
      down vote













      Had the same problem on Ubuntu 16.04 on a newly created openstack remote vm. sudo su hanged for many seconds, maybe up to a minute, before it either worked or not. When it worked it could be made quick and reliable by running this once as root:



      echo 127.0.0.1 localhost $(hostname) >> /etc/hosts





      share|improve this answer






















        up vote
        2
        down vote










        up vote
        2
        down vote









        Had the same problem on Ubuntu 16.04 on a newly created openstack remote vm. sudo su hanged for many seconds, maybe up to a minute, before it either worked or not. When it worked it could be made quick and reliable by running this once as root:



        echo 127.0.0.1 localhost $(hostname) >> /etc/hosts





        share|improve this answer












        Had the same problem on Ubuntu 16.04 on a newly created openstack remote vm. sudo su hanged for many seconds, maybe up to a minute, before it either worked or not. When it worked it could be made quick and reliable by running this once as root:



        echo 127.0.0.1 localhost $(hostname) >> /etc/hosts






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 24 at 11:17









        Kjetil S.

        1213




        1213






















            up vote
            0
            down vote













            The problem can reproduced when the hostname is changed , edit your /etc/hosts by adding the output of echo $HOSTNAME after 127.0.0.1:



            127.0.0.1 hostname





            share|improve this answer




















            • I configured it correctly, the issue was fixed but now its back again for no reason. Not sure what the issue is still :(
              – Ahmed Soliman
              Oct 28 '17 at 21:29














            up vote
            0
            down vote













            The problem can reproduced when the hostname is changed , edit your /etc/hosts by adding the output of echo $HOSTNAME after 127.0.0.1:



            127.0.0.1 hostname





            share|improve this answer




















            • I configured it correctly, the issue was fixed but now its back again for no reason. Not sure what the issue is still :(
              – Ahmed Soliman
              Oct 28 '17 at 21:29












            up vote
            0
            down vote










            up vote
            0
            down vote









            The problem can reproduced when the hostname is changed , edit your /etc/hosts by adding the output of echo $HOSTNAME after 127.0.0.1:



            127.0.0.1 hostname





            share|improve this answer












            The problem can reproduced when the hostname is changed , edit your /etc/hosts by adding the output of echo $HOSTNAME after 127.0.0.1:



            127.0.0.1 hostname






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 28 '17 at 18:06









            GAD3R

            22.7k154895




            22.7k154895











            • I configured it correctly, the issue was fixed but now its back again for no reason. Not sure what the issue is still :(
              – Ahmed Soliman
              Oct 28 '17 at 21:29
















            • I configured it correctly, the issue was fixed but now its back again for no reason. Not sure what the issue is still :(
              – Ahmed Soliman
              Oct 28 '17 at 21:29















            I configured it correctly, the issue was fixed but now its back again for no reason. Not sure what the issue is still :(
            – Ahmed Soliman
            Oct 28 '17 at 21:29




            I configured it correctly, the issue was fixed but now its back again for no reason. Not sure what the issue is still :(
            – Ahmed Soliman
            Oct 28 '17 at 21:29

















             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f401008%2fsudo-command-hangs%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay