0

I'm trying to setup my ssh server at home, but cannot make it work yet.

  1. I already forwarded the IP inside the router website.

  2. I have an external IP. I can access to my router's config using it.

  3. I pointed the ssh server config to the internal IP I am doing the port forwarding to
  4. I can connect using that port both with my local ip, and with the LAN ip.
  5. set ufw to allow all connections on that port

tcpdump shows packets coming. Nothing more.

What am I missing?

sshd config

Port 3022
#AddressFamily any
ListenAddress 0.0.0.0

ufw

root@f1:/home/blas# ufw status
Status: active

To                         Action      From
--                         ------      ----
3022                       ALLOW       Anywhere                  
3022 (v6)                  ALLOW       Anywhere (v6)   

ssh client

blas@f1:~$ ssh -vvv -p 3022 <EXTERNAL IP>
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /home/blas/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "<EXTERNAL IP>" port 3022
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to <EXTERNAL IP> [<EXTERNAL IP>] port 3022.
ssh: connect to host <EXTERNAL IP> port 3022: Connection timed out

tcpdump

listening on wlx7cdd90d820e0, link-type EN10MB (Ethernet), capture size 262144 bytes
20:17:22.471642 IP f1.44176 > <><><>.3022: Flags [S], seq 1768782276, win 29200, options [mss 1460,sackOK,TS val 4260014729 ecr 0,nop,wscale 7], length 0
    0x0000:  4500 003c 84dc 4000 4006 8943 c0a8 000a  E..<..@.@..C....
    0x0010:  50a2 1b48 ac90 0bce 696d 79c4 0000 0000  P..H....imy.....
    0x0020:  a002 7210 654e 0000 0204 05b4 0402 080a  ..r.eN..........
    0x0030:  fdea aa89 0000 0000 0103 0307            ............
20:17:23.467625 IP f1.44176 > <><><>.3022: Flags [S], seq 1768782276, win 29200, options [mss 1460,sackOK,TS val 4260015750 ecr 0,nop,wscale 7], length 0
    0x0000:  4500 003c 84dd 4000 4006 8942 c0a8 000a  E..<..@.@..B....
    0x0010:  50a2 1b48 ac90 0bce 696d 79c4 0000 0000  P..H....imy.....
    0x0020:  a002 7210 6151 0000 0204 05b4 0402 080a  ..r.aQ..........
    0x0030:  fdea ae86 0000 0000 0103 0307            ............
20:17:25.503632 IP f1.44176 > <><><>.3022: Flags [S], seq 1768782276, win 29200, options [mss 1460,sackOK,TS val 4260017766 ecr 0,nop,wscale 7], length 0
    0x0000:  4500 003c 84de 4000 4006 8941 c0a8 000a  E..<..@.@..A....
    0x0010:  50a2 1b48 ac90 0bce 696d 79c4 0000 0000  P..H....imy.....
    0x0020:  a002 7210 5971 0000 0204 05b4 0402 080a  ..r.Yq..........
    0x0030:  fdea b666 0000 0000 0103 0307            ...f........
20:17:29.519614 IP f1.44176 > <><><>.3022: Flags [S], seq 1768782276, win 29200, options [mss 1460,sackOK,TS val 4260021798 ecr 0,nop,wscale 7], length 0
    0x0000:  4500 003c 84df 4000 4006 8940 c0a8 000a  E..<..@.@..@....
    0x0010:  50a2 1b48 ac90 0bce 696d 79c4 0000 0000  P..H....imy.....
    0x0020:  a002 7210 49b1 0000 0204 05b4 0402 080a  ..r.I...........
    0x0030:  fdea c626 0000 0000 0103 0307            ...&........

  • As what user are you trying to connect via ssh? Is there an AllowUsers line in your /etc/ssh/sshd_config including that user? – Nasir Riley Jun 30 at 21:21
  • Hi. There is not. But, as stated in point 4. I am able to connect when changing the IP to 127.0.0.1, or to the one of my LAN. It's actually timing out, and not failing authentication. – blasrodri Jul 1 at 6:06

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.