I have 3 Computers:
1. my mac with macOS Catalina
2. my 1st Raspberry Pi
3. my 2nd Raspberry Pi
On my mac is ssh running version: OpenSSH_8.1p1, OpenSSL 1.1.1d 10 Sep 2019
I am able to log into each raspberry pi separately via ssh.
I want to ssh from my mac to the 2nd Pi by jumping over the 1st Pi. Like this:
+-------+ +--------+ +--------+
| Mac | ----> | raspi1 | ----> | raspi2 |
+-------+ +--------+ +--------+
with this .ssh/config file:
Host 1pi
HostName raspi1
User pi
#IdentityFile ~/.ssh/id_ed25519
Host 2pi
HostName raspi2
User pi
ProxyJump 1pi
#IdentityFile ~/.ssh/id_ed25519
Though I am able to log into the 1st Raspberry Pi, I am always getting the same error when attempting to log into the 2nd Pi.
$ ssh 2pi
kex_exchange_identification: banner line contains invalid characters
I have even tried it with the IdentityFile parameter and just using the -J option. But still the same result.
$ ssh -J pi@raspi1 pi@raspi2
kex_exchange_identification: banner line contains invalid characters
I tried it on macOS Mojave and it worked. I tried it on Linux and it worked.
How do I get it to work on macOS Catalina? How can I jump to the 2nd Pi over the 1st Pi?
When I do ssh 2pi -vv
I get this (among other debug information)
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 2097152 rmax 32768
debug1: kex_exchange_identification: banner line 0: \033[H\033[2JSSH-2.0-OpenSSH_7.9p1 Raspbian-10+deb10u1
kex_exchange_identification: banner line contains invalid characters
debug1: channel 0: free: direct-tcpip: listening port 0 for raspi2 port 22, connect from 127.0.0.1 port 65535 to UNKNOWN port 65536, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Killed by signal 1.
ssh -vv
to see the actual banner being sent.ssh raspi2
from withinraspi1
~/.profile
,~/.bash_profile
,~/.bash_login
, or~/bashrc
(assuming you're using bash as your shell on that system; if not, similar names for whatever shell you are using).