This is how things are by default. I did not set anything up.
debian server has a network connection on
eno2 with ip
192.168.1.40. Internet, sshd, Everything works fine.
Now I've added a second connection to
eno4. It's a direct link (no router or switch) to another computer for management purposes. Let's call this one client. On the client, this automatically showed up as
10.0.0.2. I can ping from the client.
On the server, there was no ip address assigned. But I could netcat from the client just fine, because I only needed the client ip address.
$ echo "Some big ZFS pool here" | nc -l -p 5555
$ nc -w 10 10.0.0.2 5555 | cat Some big ZFS pool here
Now I want to connect to sshd on the server using this connection.
However, connection is refused. I can connect via LAN and internet over the default
192.168.1.40 connection just fine. Just not over this direct link.
sshd listens to all incoming connections on all interfaces. Perhaps
eno4 just needs an IPv4 address. So I did:
$ sudo ip addr add 10.0.0.1/8 dev eno4 $ ip addr show eno4 5: eno4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 0a:a5:6a:1b:a2:22 brd ff:ff:ff:ff:ff:ff inet 10.0.0.1/8 scope global eno4 valid_lft forever preferred_lft forever
I can ping
10.0.0.1 from the server. I can netcat. However, I can not ssh.
There are a lot of long long reads with a lot of work addressing all kinds of routing tables and stuff on the web. But I really don't know anything about routing, it's necessity, alternatives, and I'd probably spend the entire day trying it out. But is it really that complex? I can ping. I can netcat. What is the absolute simplest way to get
ssh to work on interface? Might even be temporary, so I can get stuff done now?
And, optionally, what is a better permanent solution?
sshd is already supposedly listening to everything, and I don't want it to stop listening. I'd prefer not to change the sshd configuration or even restarting sshd, because the server is in active use.
The only thing initially changed on this server is the port:
# This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. Port 22222 #AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress :: ... snip ...