0
2
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.
2First figure out why it doesn't work... use
ssh -vv
to see the actual banner being sent. – user1686 – 2019-12-18T13:21:17.147Yes, I can
ssh raspi2
from withinraspi1
– Hendrik – 2019-12-18T18:39:05.807That banner looks like it starts with escape sequences to clear the screen and put the cursor at the top left. Do you have a login/profile file on the 1st Pi that tries to reset the terminal? – Gordon Davisson – 2019-12-19T17:37:38.763
Where do I find a login/profile file? – Hendrik – 2020-01-06T19:45:36.923
@Hendrik Look on raspi1, for something like
~/.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). – Gordon Davisson – 2020-01-09T09:11:35.913I'm having the same issue. It's just a bandaid, but you can
brew install openssh
andbrew link openssh
. Everything seems to work with OpenSSH_8.2p1, except forUseKeychain
if that's something you use. – Dan VanWinkle – 2020-02-27T00:41:55.683