ssh: connect to host localhost port 22: No route to host

Hi Apple Support team,


My os x version EI Capitan.


Not able to connect ssh on terminal


Getting this type of issue on terminal: ssh: connect to host localhost port 22: No route to host

MacBook Pro, OS X El Capitan (10.11)

Posted on Mar 2, 2016 3:55 AM

Reply
1 reply

Mar 2, 2016 6:20 AM in response to gurumohan reddy

Hi Apple Support team,

Just to be clear, this is a User-to-User forum. It is not a channel to Apple Support. But often you can get very good help here.


The obvious question is, do you have System Preferences -> Sharing -> Remote Login enabled?


Does your /etc/hosts file have a correct 'localhost' entry

grep localhost /etc/hosts

# localhost is used to configure the loopback interface

127.0.0.1 localhost

::1 localhost

fe80::1%lo0 localhost

Does your ifconfig lo0 look something like this:

ifconfig lo0

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384

options=3<RXCSUM,TXCSUM>

inet6 ::1 prefixlen 128

inet 127.0.0.1 netmask 0xff000000

inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1

nd6 options=1<PERFORMNUD>

Are you running any 3rd party utilities that might be monitoring your network communications, such as an anti-virus package, or LittleSnitch?


Are you running any VPN software, and is it actively connected to the remote VPN server? Some VPN setups block ALL from connections across the VPN.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

ssh: connect to host localhost port 22: No route to host

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.