connect to host localhost port 22: Connection refused





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







1















I created a Ubuntu Vagrant box and ssh'd into it.



Now, created a ssh key and trying to ssh to my localhost but I get the following error.



vagrant@vagrant-ubuntu-trusty-64:~$ ssh -vvvv localhost 
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: connect to address 127.0.0.1 port 22: Connection refused
ssh: connect to host localhost port 22: Connection refused


When I check the list of ports opened as follows:



vagrant@vagrant-ubuntu-trusty-64:~$ sudo netstat -tulpn|grep 22
tcp 0 0 10.0.2.15:22 0.0.0.0:*
LISTEN 11598/sshd


I see the ip address as 10.0.2.15:22. Also, my sshd service is running as well.



vagrant@vagrant-ubuntu-trusty-64:~$ ps aux|grep ssh
root 11430 0.0 0.7 68084 3688 ? Ss 17:41 0:00 sshd: vagrant [priv]
vagrant 11432 0.0 0.3 68216 1908 ? S 17:41 0:00 sshd: vagrant@pts/0
root 11598 0.0 0.6 61388 3060 ? Ss 17:44 0:00 /usr/sbin/sshd -D









share|improve this question

















This question has an open bounty worth +50
reputation from Aditya Narayan Dixit ending in 7 days.


This question has not received enough attention.























    1















    I created a Ubuntu Vagrant box and ssh'd into it.



    Now, created a ssh key and trying to ssh to my localhost but I get the following error.



    vagrant@vagrant-ubuntu-trusty-64:~$ ssh -vvvv localhost 
    OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 19: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to localhost [127.0.0.1] port 22.
    debug1: connect to address 127.0.0.1 port 22: Connection refused
    ssh: connect to host localhost port 22: Connection refused


    When I check the list of ports opened as follows:



    vagrant@vagrant-ubuntu-trusty-64:~$ sudo netstat -tulpn|grep 22
    tcp 0 0 10.0.2.15:22 0.0.0.0:*
    LISTEN 11598/sshd


    I see the ip address as 10.0.2.15:22. Also, my sshd service is running as well.



    vagrant@vagrant-ubuntu-trusty-64:~$ ps aux|grep ssh
    root 11430 0.0 0.7 68084 3688 ? Ss 17:41 0:00 sshd: vagrant [priv]
    vagrant 11432 0.0 0.3 68216 1908 ? S 17:41 0:00 sshd: vagrant@pts/0
    root 11598 0.0 0.6 61388 3060 ? Ss 17:44 0:00 /usr/sbin/sshd -D









    share|improve this question

















    This question has an open bounty worth +50
    reputation from Aditya Narayan Dixit ending in 7 days.


    This question has not received enough attention.



















      1












      1








      1


      1






      I created a Ubuntu Vagrant box and ssh'd into it.



      Now, created a ssh key and trying to ssh to my localhost but I get the following error.



      vagrant@vagrant-ubuntu-trusty-64:~$ ssh -vvvv localhost 
      OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
      debug1: Reading configuration data /etc/ssh/ssh_config
      debug1: /etc/ssh/ssh_config line 19: Applying options for *
      debug2: ssh_connect: needpriv 0
      debug1: Connecting to localhost [127.0.0.1] port 22.
      debug1: connect to address 127.0.0.1 port 22: Connection refused
      ssh: connect to host localhost port 22: Connection refused


      When I check the list of ports opened as follows:



      vagrant@vagrant-ubuntu-trusty-64:~$ sudo netstat -tulpn|grep 22
      tcp 0 0 10.0.2.15:22 0.0.0.0:*
      LISTEN 11598/sshd


      I see the ip address as 10.0.2.15:22. Also, my sshd service is running as well.



      vagrant@vagrant-ubuntu-trusty-64:~$ ps aux|grep ssh
      root 11430 0.0 0.7 68084 3688 ? Ss 17:41 0:00 sshd: vagrant [priv]
      vagrant 11432 0.0 0.3 68216 1908 ? S 17:41 0:00 sshd: vagrant@pts/0
      root 11598 0.0 0.6 61388 3060 ? Ss 17:44 0:00 /usr/sbin/sshd -D









      share|improve this question
















      I created a Ubuntu Vagrant box and ssh'd into it.



      Now, created a ssh key and trying to ssh to my localhost but I get the following error.



      vagrant@vagrant-ubuntu-trusty-64:~$ ssh -vvvv localhost 
      OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
      debug1: Reading configuration data /etc/ssh/ssh_config
      debug1: /etc/ssh/ssh_config line 19: Applying options for *
      debug2: ssh_connect: needpriv 0
      debug1: Connecting to localhost [127.0.0.1] port 22.
      debug1: connect to address 127.0.0.1 port 22: Connection refused
      ssh: connect to host localhost port 22: Connection refused


      When I check the list of ports opened as follows:



      vagrant@vagrant-ubuntu-trusty-64:~$ sudo netstat -tulpn|grep 22
      tcp 0 0 10.0.2.15:22 0.0.0.0:*
      LISTEN 11598/sshd


      I see the ip address as 10.0.2.15:22. Also, my sshd service is running as well.



      vagrant@vagrant-ubuntu-trusty-64:~$ ps aux|grep ssh
      root 11430 0.0 0.7 68084 3688 ? Ss 17:41 0:00 sshd: vagrant [priv]
      vagrant 11432 0.0 0.3 68216 1908 ? S 17:41 0:00 sshd: vagrant@pts/0
      root 11598 0.0 0.6 61388 3060 ? Ss 17:44 0:00 /usr/sbin/sshd -D






      networking virtualbox ssh connection vagrant






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 14 '17 at 18:14









      usmanayubsh

      371516




      371516










      asked Sep 14 '17 at 17:50









      user1050619user1050619

      2541416




      2541416






      This question has an open bounty worth +50
      reputation from Aditya Narayan Dixit ending in 7 days.


      This question has not received enough attention.








      This question has an open bounty worth +50
      reputation from Aditya Narayan Dixit ending in 7 days.


      This question has not received enough attention.
























          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          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%2faskubuntu.com%2fquestions%2f955870%2fconnect-to-host-localhost-port-22-connection-refused%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • 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%2faskubuntu.com%2fquestions%2f955870%2fconnect-to-host-localhost-port-22-connection-refused%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

          GameSpot

          日野市

          Tu-95轟炸機