connect to host localhost port 22: Connection refused

前端 未结 28 2217
误落风尘
误落风尘 2021-01-29 19:01

While installing hadoop in my local machine , i got following error

ssh -vvv localhost 
OpenSSH_5.5p1, OpenSSL 1.0.0e-fips 6 Sep 2011 
debug1: Reading configura         


        
相关标签:
28条回答
  • 2021-01-29 19:40

    For Linux:

    1. Remove SSH with the following command:

      sudo apt-get remove openssh-client openssh-server
      
    2. Install SSH again with:

      sudo apt-get install openssh-client openssh-server
      
    0 讨论(0)
  • 2021-01-29 19:41

    Actually i solved this, I just installed shh daemon.

    in terminal :

    sudo apt-get install openssh-server

    0 讨论(0)
  • 2021-01-29 19:43

    It might be caused by some of the following:

    1. SSH Server is not installed (only SSH Client), try: apt-get install ssh openssh-client openssh-server
    2. Connection is blocked by iptables (Firewall), try: ufw allow ssh
    0 讨论(0)
  • 2021-01-29 19:43

    If you're certain that you have installed ssh, then it's possible that ssh and/or sshd has been terminated or the server service hasn't been started. To check whether these processes are running use:

    //this tells you whether your ssh instance is active/inactive
    sudo service ssh status
    

    OR

    //this list all running processes whose names contain the string "ssh"
    sudo ps -A | grep ssh
    

    It's likely that ssh would be active and running but sshd would not. To enable them:

    sudo service ssh start
    

    NB; - some systems have a restart option but mine didn't

    0 讨论(0)
  • 2021-01-29 19:44

    For my case(ubuntu 14.04, fresh installed), I just run the following command and it works!

    sudo apt-get install ssh

    0 讨论(0)
  • 2021-01-29 19:44

    A way to do is to go to terminal

    $ sudo gedit /etc/hosts
    
    ***enter your ip address ipaddress of your pc  localhost 
        ipaddress of your pc  localhost(Edit your pc name with localhost) **
    

    and again restart your ssh service using:

    $ service ssh restart
    

    Problem will be resolve. Thanks

    0 讨论(0)
提交回复
热议问题