1

I have finally got a public IP from my ISP and I am trying to set up an SSH server over the internet so I can connect to my computer. When I connect from my local network there are no problems at all but when I connect from the internet I get this message:

[oliver@brick ~]$ ssh -v oliver@{IP}
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
debug1: /etc/ssh/ssh_config.d/05-redhat.conf line 2: include /etc/crypto-policies/back-ends/openssh.config matched no files
debug1: /etc/ssh/ssh_config.d/05-redhat.conf line 8: Applying options for *
debug1: Connecting to {IP} [{IP}] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/oliver/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/oliver/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/oliver/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/oliver/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/oliver/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/oliver/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/oliver/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/oliver/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version dropbear_0.51
debug1: no match: dropbear_0.51
debug1: Authenticating to {IP}:22 as 'oliver'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: (no match)
Unable to negotiate with {IP} port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

I have also tried to then specify diffie-hellman-group1-sha1 as the key exchange method and it then connects but after it asks for the password it says permission denied even though I know I entered the correct one. But I don't understand what is wrong because if I run ssh -Q kex on both client and server they both have way more than one key exchange method that match and shouldn't it be the same as connecting locally? I have of course configured my router to forward port 22. I have tried this on multiple machines with different computers as both server and client. I haven't configured sshd_config at all. What is wrong? I am running Arch Linux and Fedora on the computers I have tried with but I have also tried with an android phone to connect

closed as off-topic by Jeff Schaller, phk, Michael Homer, G-Man, sebasth Jan 22 '18 at 7:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, phk, Michael Homer, G-Man, sebasth
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Are you trying to set up OpenSSH or dropbear as your ssh server? – user4556274 Jan 14 '18 at 11:28
  • I am using openssh – Coding Guy Jan 14 '18 at 11:30
  • 2
    Your debug output shows you connecting to a dropbear server. If that is not your intent, I expect you are connecting to your router running dropbear, rather than a machine behind your router. – user4556274 Jan 14 '18 at 11:31
  • Weird. I could try opening another port on the router if port 22 is reserved for the router but seems weird it is just a cheap router I got from my ISP – Coding Guy Jan 14 '18 at 11:35
  • 2
    dropbear is a low resource ssh server commonly used on low resource machines, like a cheap router from an ISP. If you cannot disable dropbear, then yes, portforward a different port. – user4556274 Jan 14 '18 at 11:37
1

My router was also running an SSH server so the client was trying to connect to that. I just used another port for forwarding and it worked. Thx to user4556274 for figuring it out by reading the debug output that revealed I was connecting to a dropbear server and not the OpenSSH server I was running

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