connect to host localhost port 22: Connection refused

前端 未结 28 2215
误落风尘
误落风尘 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:33

    Make sure that /etc/hosts.allow contains:

    ssh:ALL:allow
    sshd:ALL:allow
    

    OR

    ssh:localhost:allow
    sshd:localhost:allow
    

    OR - some other variant

    ssh:{host1,host2,host3...}:allow
    sshd{host1,host2,host3...}:allow
    

    INSURE that the first line in the file DOES NOT begin with ALL:ALL:DENY

    NOTHING will be able to communicate with the host... on any port.

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

    I did all the suggestion above and it did not work. Then I restart the ssh service and it works. This is what I do:

    service ssh restart
    

    Then I redo

    ssh localhost
    

    Now I can connect to my localhost. Hope it helps

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

    Do you have sshd installed? You can verify that with:

    which ssh
    which sshd
    

    For detailed information you can visit this link.

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

    you need to check the configuration in sshd_config ListenAddress 0.0.0.0 update this and restart the sshd service that will resolve the issue.

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

    if you are using centOS or Red Hat, you should first update SElinux. Execute the following statement

    ausearch -c 'sshd' --raw | audit2allow -M my-sshd
    

    then you need to execute

    semodule -i my-sshd.pp
    

    good luck

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

    On mac go to system settings->network->sharing and allow remote login.

    try ssh localhost

    You should be good.

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