Okay, this is a weird one. I normally don't ask questions here, but I'm about 5 hours in and my brain is melting.
I have set up a sftp server on my network with the following attributes in my sshd_config file:
Match group sftp
ChrootDirectory /home
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp -d /dataUser/drive1/data/
This works perfectly fine when I use it locally and I can also connect to the root user when I connect locally from another PC. The device has the local IP 192.168.0.42
. Let's call this device A.
Now I want to use this over the internet, so naturally, I forwarded port 4000 to port 22 on this device:
port forwarding - left number LAN, right number WAN Port.
Ok. So let's try to connect.
Error message: Connection timed out
So is it the port forwarding? I have another Server on WAN port 42069 that forwards to the LAN IP 31 with Port 22 (and also other ports. They all (just) work). Let's call that device B. It works fine. From inside the network and outside.
I also tried to connect to A with ssh to the root user instead of sftp to the dataUser. It works on the network, it doesn't work from the outside.
Ok, so I scanned my Ports with nmap:
Port 42069 goes to device B - STATE: open
Port 4000 goes to device A - STATE: filtered
I also tried one of those websites - CanYouSeeMee.org and apparently my ISP is not blocking this port.
So I tried the same with samba file sharing. Same result. It works inside the network, it doesn't from the outside. That Website shows my ISP is not made by the devil to waste my time and nmap shows the state 'filtered'.
I changed the ports multiple times, I deactivated my firewall in the router settings, which I already restarted two times (the same with my Client and Server for that matter).
I really don't know if this is fixable. I have currently given up on this, maybe you can help me.