SSH:远程 IP XXXX 端口 22 关闭连接

SSH:远程 IP XXXX 端口 22 关闭连接

更新 我目前正在运行20.04。我做了一些研究,发现您的ip address已注册到域。您必须改用实际域。SSH Public密钥已配置为domain。我使用简化的登录MTU。尽管进行了研究,但我仍然遇到错误。

当前问题:

我几乎尝试了所有方法来解决这个问题。当我运行ssh root@{ip.address}.This happens时Connection closed by {ip address} port 22,会出现此错误。我运行 sudo ss -tulpn | grep :22[解决了]

tcp   LISTEN 0      128           0.0.0.0:22         0.0.0.0:*    users:(("sshd"
tcp   LISTEN 0      128              [::]:22            [::]:*    users:(("sshd"

我已经允许了RootLogin 以下ssh -vvv {domain@example}

 OpenSSH_8.2p1 Ubuntu-4ubuntu0.3, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /home/user/.ssh/config
debug1: /home/user/.ssh/config line 1: Applying options for domain@example
debug3: kex names ok: [diffie-hellman-group1-sha1]
debug1: /home/user/.ssh/config line 4: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolving "domain@example" port 22
debug2: ssh_connect_direct
debug1: Connecting to domain@example [ip address] port 22.

tail -n 500 /var/log/auth.log | grep ssh

user sudo: user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/apt install openssh-server openssh-client
user useradd[17976]: new user: name=sshd, UID=128, GID=65534, home=/run/sshd, shell=/usr/sbin/nologin, from=none
user usermod[17984]: change user 'sshd' password
user chage[17991]: changed password expiry for sshd
user sshd[18118]: Server listening on 0.0.0.0 port 22.
user sshd[18118]: Server listening on :: port 22.
user sudo: user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/usr/sbin/ufw allow ssh
user sudo: user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/nano /etc/ssh/sshd_config
user polkitd(authority=local): Operator of unix-session:2 successfully authenticated as unix-user:user to gain TEMPORARY authorization for action org.freedesktop.systemd1.manage-units for system-bus-name::1.212 [systemctl restart sshd.service] (owned by unix-user:user)
user sshd[18118]: Received signal 15; terminating.
user sshd[24826]: Server listening on 0.0.0.0 port 22.
user sshd[24826]: Server listening on :: port 22.
user sudo: user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/usr/sbin/ufw allow ssh
user sshd[28153]: Accepted publickey for elizabeth from 127.0.0.1 port 32912 ssh2: RSA 
user sshd[28153]: pam_unix(sshd:session): session opened for user user by (uid=0)
user sshd[29442]: Connection closed by 127.0.0.1 port 50390 [preauth]
user sshd[29591]: Accepted publickey for user from 127.0.0.1 port 50548 ssh2: RSA 
user sshd[29591]: pam_unix(sshd:session): session opened for user user by (uid=0)
user sshd[29647]: Received disconnect from 127.0.0.1 port 50548:11: disconnected by user
user sshd[29647]: Disconnected from user user 127.0.0.1 port 50548
user sshd[29591]: pam_unix(sshd:session): session closed for user user sshd[28247]: Received disconnect from 127.0.0.1 port 32912:11: disconnected by user
user sshd[28247]: Disconnected from user user 127.0.0.1 port 32912
user sshd[28153]: pam_unix(sshd:session): session closed for user user user sshd[812]: Server listening on :: port 22.

省略了ip address我的姓名、网站和隐私密钥

确认我有authorized_keys。

  ls -l .ssh/authorized_keys

-rw------- 1 user user 573 Sep 10 18:06 .ssh/authorized_keys

相关内容