1

I've setup Ubuntu Desktop 18.04 and I'm trying to setup ssh services so that I can ssh remotely into machine from anywhere. Bellow I've included a couple of recommendations on trouble shooting the problem, but it still persists, I am welcome to any suggestions. I just want to know if I'll ever be able to ssh to my machine remotely so I can move on.

SSH with legacy options Remote Server

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c 3des-cbc 
Computer@Computer -vv
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug2: resolving "Computer" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to Computer [Computer] port 22.

TCPDUMP HOST

sudo tcpdump -i interface port 22 -vvv

18:50:47.949925 IP (tos 0x28, ttl 48, id 46536, offset 0, flags [DF], proto TCP (6), length 244)
    Computer.ssh > Computer.34798: Flags [P.], cksum 0xc9f3 (correct), seq 85512151:85512343, ack 4029662038, win 377, options [nop,nop,TS val 3486052520 ecr 3637652101], length 192
18:50:47.950859 IP (tos 0x28, ttl 48, id 46537, offset 0, flags [DF], proto TCP (6), length 132)
    Computer > Computer.34798: Flags [P.], cksum 0x4e9b (correct), seq 192:272, ack 1, win 377, options [nop,nop,TS val 3486052521 ecr 3637652101], length 80
18:50:47.950905 IP (tos 0x10, ttl 64, id 61816, offset 0, flags [DF], proto TCP (6), length 52)
    Computer > Computer.ssh: Flags [.], cksum 0x0f98 (correct), seq 1, ack 272, win 1444, options [nop,nop,TS val 3637663146 ecr 3486052520], length 0

NetCAT HOST

 nc -vv (IP) 22
 Connection to (IP) 22 port [tcp/ssh] succeeded!
 SSH-2.0-dropbear_0.46

/var/log/auth.log HOST

Feb 13 18:55:44 Computer sshd[9699]: Server listening on 0.0.0.0 port 22.
Feb 13 18:55:44 Computer sshd[9699]: Server listening on :: port 22.
Feb 13 18:55:44 Computer polkitd(authority=local): Unregistered Authentication Agent for unix-process:9689:610496 (system bus name :1.203, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_CA.UTF-8) (disconnected from bus)

FIREWALL HOST

sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere                  
22                         ALLOW       Anywhere   

MISC

Systemctl restart sshd
Systemctl enable sshd
Systemctl enable ufw          
1

If you're trying to remote in from outside of your home network, the configuration needs to be done on your router. Specifically, enable port forwarding on port 22 on your router to your server.

There's a few precautions to take in mind with this, however. Exposing a server to the internet is a dangerous thing and shouldn't be taken lightly. At a minimum, you should have a VERY strong, and long password for the login account, and strictly disable root logins through SSH. A further step is to use encryption keys, and limit logins only to those with the keys. A step even further would be to change which port SSH uses from 22, as I can say from experience that this port is completely flooded with would-be hackers; you WILL get a login attempt every couple seconds from brute force attackers.

  • I'll accept this as an answer, beucase it's very informative and because my router/modem does not support port forwarding, but does support port triggering so that could be the problem. – Ovie Adese Feb 14 at 18:56

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.