0

I have 100+ embedded devices each opening a few ssh tunnels to a Ubuntu 18.04 server.

One of the devices can't open the tcp4 version of one port. As far as I can tell there is nothing else listening on that port.

It's trying to open port 48110.

This is the output of netstat after trying to open the port:

$ sudo netstat -ntlp | grep 4811
tcp        0      0 0.0.0.0:48112           0.0.0.0:*               LISTEN      15039/sshd: tmp     
tcp        0      0 0.0.0.0:48114           0.0.0.0:*               LISTEN      15126/sshd: tmp     
tcp        0      0 0.0.0.0:48115           0.0.0.0:*               LISTEN      15208/sshd: tmp     
tcp6       0      0 :::48110                :::*                    LISTEN      13738/sshd: tmp     
tcp6       0      0 :::48112                :::*                    LISTEN      15039/sshd: tmp     
tcp6       0      0 :::48114                :::*                    LISTEN      15126/sshd: tmp     
tcp6       0      0 :::48115                :::*                    LISTEN      15208/sshd: tmp 

It's connecting with the command:

ssh -fN -R 48110:localhost:9990 user@hostname

ufw has the ports open:

$ sudo ufw status | grep 4811          
48110                      ALLOW       Anywhere                  
48112                      ALLOW       Anywhere                  
48114                      ALLOW       Anywhere                  
48115                      ALLOW       Anywhere                  
48119                      ALLOW       Anywhere                  
48110 (v6)                 ALLOW       Anywhere (v6)             
48112 (v6)                 ALLOW       Anywhere (v6)             
48114 (v6)                 ALLOW       Anywhere (v6)             
48115 (v6)                 ALLOW       Anywhere (v6)             
48119 (v6)                 ALLOW       Anywhere (v6) 

nmap from another PC says the port is closed, as I think it should:

$ nmap -p 48110 hostname
PORT      STATE  SERVICE
48110/tcp closed unknown

nmap to a connected port, 48112:

$ nmap -p 48112 hostname
PORT      STATE  SERVICE
48112/tcp open unknown

nmap to an unblocked but unconnected port, 48119:

$ nmap -p 48119 hostname
PORT      STATE  SERVICE
48119/tcp closed unknown

Can something be using that port that doesn't show in netstat?

  • Can you try to specify ipv4 address? Something like: ssh -fN -R 0.0.0.0:48110:localhost:9990 user@hostname or ssh -fN -R ipv4_of_device:48110:localhost:9990 user@hostname – Martynas Saint Aug 7 '19 at 13:44
  • Both of those have the same result as without specifying the ipv4 address. tcp6 connection opened, no tcp4 connection. – Johan Aug 7 '19 at 15:42
  • what does an nmap of port 48112 say? – Smock Aug 7 '19 at 16:33
  • 48112/tcp open unknown – Johan Aug 8 '19 at 10:28
  • Try running ssh with -vv. You should see lines like this: debug1: Local connections to LOCALHOST:8080 forwarded to remote address localhost:8080 debug1: Local forwarding listening on ::1 port 8080. debug1: channel 0: new [port listener] debug1: Local forwarding listening on 127.0.0.1 port 8080. debug1: channel 1: new [port listener] see if something looks different between the working and non-working ports – Matt Zimmerman Aug 18 '19 at 0:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.