what's the difference between /etc/init.d/sshd start and /usr/sbin/sshd?












4















I'm having issues with passwordless ssh. I've checked, double checked and checked again that I have everything set up correctly.



Both machines are RHEL6 and when the destination machine first boots up passwordless ssh does not work. If I stop ssh (service sshd stop or /ect/init.d/sshd stop) and then start it directly (/usr/sbin/sshd) passwordless ssh works fine.



If I start ssh via the service (service sshd start or /etc/init.d/sshd start) passwordless ssh does not work.



Just for testing I've tried commenting out the entire start() function in /etc/init.d/sshd and replace it with /usr/sbin/sshd - that still fails to allow passwordless ssh. I believe that this means that something in the /etc/init.d/sshd file is causing the screw up but I don't know enough about linux to narrow the issue down.










share|improve this question


















  • 1





    Just to help me guess what is wrong, right after reboot, do /etc/init.d/sshd stop; /etc/init.d/sshd start and report back whether that (temporarily) fixed it.

    – BenjiWiebe
    Oct 29 '12 at 23:50






  • 1





    "Does not work" is really not a very good description of the problem. Does the sshd service run? Do you see the process in the process table? Do you get prompted for a password or do you get an error message?

    – David Schwartz
    Oct 30 '12 at 0:11











  • What is "paswordless ssh"? Do you mean authentication keys?

    – Ярослав Рахматуллин
    Nov 15 '12 at 17:45
















4















I'm having issues with passwordless ssh. I've checked, double checked and checked again that I have everything set up correctly.



Both machines are RHEL6 and when the destination machine first boots up passwordless ssh does not work. If I stop ssh (service sshd stop or /ect/init.d/sshd stop) and then start it directly (/usr/sbin/sshd) passwordless ssh works fine.



If I start ssh via the service (service sshd start or /etc/init.d/sshd start) passwordless ssh does not work.



Just for testing I've tried commenting out the entire start() function in /etc/init.d/sshd and replace it with /usr/sbin/sshd - that still fails to allow passwordless ssh. I believe that this means that something in the /etc/init.d/sshd file is causing the screw up but I don't know enough about linux to narrow the issue down.










share|improve this question


















  • 1





    Just to help me guess what is wrong, right after reboot, do /etc/init.d/sshd stop; /etc/init.d/sshd start and report back whether that (temporarily) fixed it.

    – BenjiWiebe
    Oct 29 '12 at 23:50






  • 1





    "Does not work" is really not a very good description of the problem. Does the sshd service run? Do you see the process in the process table? Do you get prompted for a password or do you get an error message?

    – David Schwartz
    Oct 30 '12 at 0:11











  • What is "paswordless ssh"? Do you mean authentication keys?

    – Ярослав Рахматуллин
    Nov 15 '12 at 17:45














4












4








4








I'm having issues with passwordless ssh. I've checked, double checked and checked again that I have everything set up correctly.



Both machines are RHEL6 and when the destination machine first boots up passwordless ssh does not work. If I stop ssh (service sshd stop or /ect/init.d/sshd stop) and then start it directly (/usr/sbin/sshd) passwordless ssh works fine.



If I start ssh via the service (service sshd start or /etc/init.d/sshd start) passwordless ssh does not work.



Just for testing I've tried commenting out the entire start() function in /etc/init.d/sshd and replace it with /usr/sbin/sshd - that still fails to allow passwordless ssh. I believe that this means that something in the /etc/init.d/sshd file is causing the screw up but I don't know enough about linux to narrow the issue down.










share|improve this question














I'm having issues with passwordless ssh. I've checked, double checked and checked again that I have everything set up correctly.



Both machines are RHEL6 and when the destination machine first boots up passwordless ssh does not work. If I stop ssh (service sshd stop or /ect/init.d/sshd stop) and then start it directly (/usr/sbin/sshd) passwordless ssh works fine.



If I start ssh via the service (service sshd start or /etc/init.d/sshd start) passwordless ssh does not work.



Just for testing I've tried commenting out the entire start() function in /etc/init.d/sshd and replace it with /usr/sbin/sshd - that still fails to allow passwordless ssh. I believe that this means that something in the /etc/init.d/sshd file is causing the screw up but I don't know enough about linux to narrow the issue down.







ssh passwords redhat-enterprise-linux






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 29 '12 at 22:48









jasonojasono

2112




2112








  • 1





    Just to help me guess what is wrong, right after reboot, do /etc/init.d/sshd stop; /etc/init.d/sshd start and report back whether that (temporarily) fixed it.

    – BenjiWiebe
    Oct 29 '12 at 23:50






  • 1





    "Does not work" is really not a very good description of the problem. Does the sshd service run? Do you see the process in the process table? Do you get prompted for a password or do you get an error message?

    – David Schwartz
    Oct 30 '12 at 0:11











  • What is "paswordless ssh"? Do you mean authentication keys?

    – Ярослав Рахматуллин
    Nov 15 '12 at 17:45














  • 1





    Just to help me guess what is wrong, right after reboot, do /etc/init.d/sshd stop; /etc/init.d/sshd start and report back whether that (temporarily) fixed it.

    – BenjiWiebe
    Oct 29 '12 at 23:50






  • 1





    "Does not work" is really not a very good description of the problem. Does the sshd service run? Do you see the process in the process table? Do you get prompted for a password or do you get an error message?

    – David Schwartz
    Oct 30 '12 at 0:11











  • What is "paswordless ssh"? Do you mean authentication keys?

    – Ярослав Рахматуллин
    Nov 15 '12 at 17:45








1




1





Just to help me guess what is wrong, right after reboot, do /etc/init.d/sshd stop; /etc/init.d/sshd start and report back whether that (temporarily) fixed it.

– BenjiWiebe
Oct 29 '12 at 23:50





Just to help me guess what is wrong, right after reboot, do /etc/init.d/sshd stop; /etc/init.d/sshd start and report back whether that (temporarily) fixed it.

– BenjiWiebe
Oct 29 '12 at 23:50




1




1





"Does not work" is really not a very good description of the problem. Does the sshd service run? Do you see the process in the process table? Do you get prompted for a password or do you get an error message?

– David Schwartz
Oct 30 '12 at 0:11





"Does not work" is really not a very good description of the problem. Does the sshd service run? Do you see the process in the process table? Do you get prompted for a password or do you get an error message?

– David Schwartz
Oct 30 '12 at 0:11













What is "paswordless ssh"? Do you mean authentication keys?

– Ярослав Рахматуллин
Nov 15 '12 at 17:45





What is "paswordless ssh"? Do you mean authentication keys?

– Ярослав Рахматуллин
Nov 15 '12 at 17:45










2 Answers
2






active

oldest

votes


















0














It looks like the init.d version is starting with a different server key that is not recognized, but this should give you a warning om the client. It may be the case that the service is reading the configuration from some other place than you expect. It may also be the case that you have a xinetd service running that steals incoming connections to port 22.



try starting the service with mentioned methods and look for a difference in the output of



ps aux | grep [s]shd 


This may give you some clue about which config file is being used. Also, you may want to double check that sshd is listening on port 22 after you start it with /etc/init.d/sshd. This can be done with



netstat -ntpl 


Or by checking that "paswordfull" logins work.






share|improve this answer































    0














    There is a difference due to how they are executed, check this centos bug, to fix this delete first line "#!/bin/bash" from /etc/init.d/sshd






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      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',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f495865%2fwhats-the-difference-between-etc-init-d-sshd-start-and-usr-sbin-sshd%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      It looks like the init.d version is starting with a different server key that is not recognized, but this should give you a warning om the client. It may be the case that the service is reading the configuration from some other place than you expect. It may also be the case that you have a xinetd service running that steals incoming connections to port 22.



      try starting the service with mentioned methods and look for a difference in the output of



      ps aux | grep [s]shd 


      This may give you some clue about which config file is being used. Also, you may want to double check that sshd is listening on port 22 after you start it with /etc/init.d/sshd. This can be done with



      netstat -ntpl 


      Or by checking that "paswordfull" logins work.






      share|improve this answer




























        0














        It looks like the init.d version is starting with a different server key that is not recognized, but this should give you a warning om the client. It may be the case that the service is reading the configuration from some other place than you expect. It may also be the case that you have a xinetd service running that steals incoming connections to port 22.



        try starting the service with mentioned methods and look for a difference in the output of



        ps aux | grep [s]shd 


        This may give you some clue about which config file is being used. Also, you may want to double check that sshd is listening on port 22 after you start it with /etc/init.d/sshd. This can be done with



        netstat -ntpl 


        Or by checking that "paswordfull" logins work.






        share|improve this answer


























          0












          0








          0







          It looks like the init.d version is starting with a different server key that is not recognized, but this should give you a warning om the client. It may be the case that the service is reading the configuration from some other place than you expect. It may also be the case that you have a xinetd service running that steals incoming connections to port 22.



          try starting the service with mentioned methods and look for a difference in the output of



          ps aux | grep [s]shd 


          This may give you some clue about which config file is being used. Also, you may want to double check that sshd is listening on port 22 after you start it with /etc/init.d/sshd. This can be done with



          netstat -ntpl 


          Or by checking that "paswordfull" logins work.






          share|improve this answer













          It looks like the init.d version is starting with a different server key that is not recognized, but this should give you a warning om the client. It may be the case that the service is reading the configuration from some other place than you expect. It may also be the case that you have a xinetd service running that steals incoming connections to port 22.



          try starting the service with mentioned methods and look for a difference in the output of



          ps aux | grep [s]shd 


          This may give you some clue about which config file is being used. Also, you may want to double check that sshd is listening on port 22 after you start it with /etc/init.d/sshd. This can be done with



          netstat -ntpl 


          Or by checking that "paswordfull" logins work.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 15 '12 at 17:54









          Ярослав РахматуллинЯрослав Рахматуллин

          8,23532965




          8,23532965

























              0














              There is a difference due to how they are executed, check this centos bug, to fix this delete first line "#!/bin/bash" from /etc/init.d/sshd






              share|improve this answer




























                0














                There is a difference due to how they are executed, check this centos bug, to fix this delete first line "#!/bin/bash" from /etc/init.d/sshd






                share|improve this answer


























                  0












                  0








                  0







                  There is a difference due to how they are executed, check this centos bug, to fix this delete first line "#!/bin/bash" from /etc/init.d/sshd






                  share|improve this answer













                  There is a difference due to how they are executed, check this centos bug, to fix this delete first line "#!/bin/bash" from /etc/init.d/sshd







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 26 '14 at 2:23









                  Anurag UniyalAnurag Uniyal

                  1466




                  1466






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f495865%2fwhats-the-difference-between-etc-init-d-sshd-start-and-usr-sbin-sshd%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Plaza Victoria

                      Puebla de Zaragoza

                      Musa