My issue is, when my sshd_config file (partial) looks like this:
Code: Select all
# Port For Local SSH Traffic
Port 40001
# Port For Public SSH Traffic
Port 40002
# IP For All Traffic
ListenAddress 0.0.0.0
# IP For Local SSH Traffic
ListenAddress 192.168.1.2:40001
# IP For Public SSH Traffic
ListenAddress 205.206.207.208:40002However, when I comment out the ListenAddress 0.0.0.0, I can only access my raspberry pi locally from 192.168.1.2:40001 and not publicly from 205.206.207.208:40002. Instead I get "connection refused" errors from my public client. This tells me that somehow, (even though I am certain that my static public ip address is correct in my public ListenAddress), my raspberry pi's sshd server is not listening to my instructions and something is overriding the sshd server to listen for ssh access from the specified public ip address. With that being said, I have tried this with zero firewalls up on all devices, and still no luck.
Below is the sshd_config that I want to use, but wont work when trying to listen for a public ip.
Code: Select all
# Port For Local SSH Traffic
Port 40001
# Port For Public SSH Traffic
Port 40002
# IP For All Traffic
# 0.0.0.0
# IP For Local SSH Traffic
ListenAddress 192.168.1.2:40001
# IP For Public SSH Traffic
ListenAddress 205.206.207.208:40002- 1) In raspi-config settings, I added (or switched?) my hostname recently, but i don't think this should affect sshd
2)In my /etc/hosts file, I noticed an extra ip address ofwhich was not there before to my knowledge. I'm assuming this was added by some program from the LEMP server I am running on my pi, but I can't know which one.Code: Select all
127.0.1.1 MyPiServer
Code: Select all
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.1.1 MyPiServer