I am trying to set up a VPN with a Raspberry Pi, and the first step is gaining the ability to ssh
into the device from outside my local network. For whatever re
For me, the problem was a typo on my ~/.ssh/config
file. I had:
Host host1:
HostName 10.10.1.1
User jlyonsmith
The problem was the :
after the host1
- it should not be there. ssh
gives no warnings for typos in the ~/.ssh/config
file. When it can't find host1
it looks for the machine locally, can't find it and prints the cryptic error message.
This was happening to me when trying to access Github. The problem is that I was in the habit of doing:
git remote add <xyz> ssh:\\git@github.com......
But, if you are having this error from the question, removing ssh:\\
may resolve the issue. It solved it for me!
Note that you will have to do a git remote remove <xyz>
and re-add the remote url without ssh:\\
.
It seems that some apps won't read symlinked /etc/hosts
(on macOS at least), you need to hardlink it.
ln /path/to/hosts_file /etc/hosts
Recently I came across the same issue. I was able to ssh to my pi on my network, but not from outside my home network.
I had already:
Also, I set up port forward on my router for hosting a web site and I had even port forward port 22 to my pi's static IP for ssh, but I left the field blank where you specify the application you are performing the port forwarding for on the router. Anyway, I added 'ssh' into this field and, VOILA! A working ssh connection from anywhere to my pi.
I'll write out my router's port forwarding settings.
(ApplicationTextField)_ssh (external port)_22 (Internal Port)_22 (Protocal)_Both (To IP Address)_192.168.1.### (Enabled)_checkBox
Port forwarding settings can be different for different routers though, so look up directions for your router.
Now, when I am outside of my home network I connect to my pi by typing:
ssh pi@[hostname]
Then I am able to input my password and connect.
I got this error by using a .yml inventory file in ansible that was not properly formatted. For multiple hosts in a group, each hostname needs to end in a hard colon ":". Otherwise ansible runs the host names together and produces this ssh error.
I had the same issue connecting to a remote machine. but I managed to login as below:
ssh -p 22 myName@hostname
or:
ssh -l myName -p 22 hostname