首先,我知道这个问题已被问过一百万次了,我已经阅读了我能找到的所有内容,但仍无法解决问题.
原文链接:https://www.f2er.com/ubuntu/348519.html我正在遇到这个问题,当我从我的mac ssh进入我的ubuntu服务器上全新安装的Ubuntu(因为这个问题我重新安装).
我有SSH端口映射到7070,因为我的ISP阻止了22.
在客户端:
bash: ssh -p 7070 -v me@address.org debug1: Reading configuration data /etc/ssh_config debug1: Connecting to address.org port 7070. debug1: Connection established. debug1: identity file /home/me/.ssh/identity type -1 debug1: identity file /home/me/.ssh/id_rsa type 1 debug1: identity file /home/me/.ssh/id_dsa type -1 ssh_exchange_identification: Connection closed by remote host
确保我的maxstartups没问题:
bash: grep MaxStartups /etc/ssh/sshd_config #MaxStartups 10:30:60
>确保hosts.deny没有否认.
>确保hosts.allow拥有我的客户端IP.
>清除客户端上的known_hosts
>将/ var / run的所有权更改为root
>确保etc / run / ssh是
>确保/ var / empty存在
>重新安装openssh-server
>重新安装ubuntu
当我运行telnet localhost时,我得到了这个:
telnet localhost Trying ::1... Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused
当我运行/usr/sbin / sshd -t时
Could not load host key: /etc/ssh/ssh_host_rsa_key Could not load host key: /etc/ssh/ssh_host_dsa_key
当我重新生成密钥时
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
我犯了同样的错误.
我很确定这是问题所在.有人可以帮忙吗?