インターネット経由でSSHサーバーに接続する方法[閉じる]

インターネット経由でSSHサーバーに接続する方法[閉じる]

ついに私のISPからパブリックIPを取得し、自分のコンピュータに接続できるようにインターネット経由でSSHサーバーを設定しようとしています。ローカルネットワークから接続しても問題はありませんが、インターネットから接続すると次のメッセージが表示されます。

[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

また、鍵交換方法としてdiffie-hellman-group1-sha1を指定して接続しようとしましたが、パスワードを要求した後に正しいパスワードを入力したことがわかっていても、権限が拒否されたと表示されます。ただし、クライアントとサーバーの両方でssh -Q kexを実行すると、どちらも一致するキー交換方法が2つ以上あるため、何が間違っているのかわかりません。ローカル接続と同じでなければなりませんか?もちろん、ポート22を転送するようにルータを設定しました。私はサーバーとクライアントとして別のコンピュータを使用して複数のコンピュータでこれを試しました。 sshd_configがまったく設定されていません。何が問題なの?お使いのコンピュータでArch LinuxとFedoraを実行していますが、Android携帯を使って接続も試みました。

ベストアンサー1

私のルーターもSSHサーバーを実行しているので、クライアントはそのサーバーに接続しようとしています。私は転送のために別のポートを使用していましたが、うまくいきました。私が実行していたOpenSSHサーバーではなくdropbearサーバーに接続していることを示すデバッグ出力を読んで、この問題を解決してくれたuser4556274に感謝します。

おすすめ記事