I'm trying to ssh into a desktop which is behind a router from a remote location. I've set the router (TP-link AC1750) to forward TCP connections to port 8000 along to port 8000 on my desktop using it's local network IP. (I'm following advice I read on a number of pages and not using the default port 22). I've included

Port 8000

in my desktop's sshd_config file so that it listens for requests on port 8000.

When I then try to ssh in from a remote machine with

ssh -p 8000 username@routers-public-ip-address

I get a timeout error. Running

ssh -p -v username@routers-public-ip-address

on the client side gives

debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: applying options for *
debug1: Connecting to <ip address> [<ip address>] port 8000
debug1: connect to address port 8000: Operation timed out
ssh: connect to host port 8000: Operation timed out

The server side logs have no indication that an attempt at a TCP connection was made.

I have no trouble ssh'ing in from a computer on the same LAN using my local IP.

I'm trying to find the logs on the router itself, as I now suspect that's where the problem is, given that the server doesn't appear to have any log of an attempted connection. Once I can find those, if it doesn't immediately solve the problem I'll update this post again.

  • why do you try to ssh to port 8584, if you set up your router to forward port 8000 ? you should try ssh -p 8000 .... – mazs Oct 30 '15 at 15:36
  • Sorry, I was using -p 8000. Just corrected the question. – Ben Oct 30 '15 at 16:20
  • 1
    Why not just try with default 22 to get it working, then change the ports? – RobertL Oct 30 '15 at 16:30
  • When you say pings do you really mean TCP connections, as that is what you really want. You will find -v option (can be specified multiple times to increase verbosity) a useful debugging tool on the client side. On the server side check logs or kill your original daemon and run sshd -D at command line to see more useful server side messages. – DanSut Oct 30 '15 at 18:39
  • Thanks, yes, I was using pings incorrectly - I edited the question. I am trying to forward TCP connections. – Ben Oct 30 '15 at 19:01

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.