SSH Secure File Transfer Client 登录时遇到问题提示:
“Connection closed by remote host the connection to the remote host was lost .
this usually means that you network connection went down or that the remote host
was rebooted most network outages are short. and thus trying again may work ”
原因之一:没有生成ssh key
在终端中输入:ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key重新建立ssh_host_dsa_key文件
以下是返回信息
Generating public/private dsa key pair.
Enter passphrase (empty for no passphrase):(直接回车)
Enter same passphrase again:(回车)
Your identification has been saved in /etc/ssh/ssh_host_dsa_key.
Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub.
The key fingerprint is:
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx root@localhost.localdomain
在终端中输入:ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key重新建立ssh_host_rsa_key文件
以下是返回信息
Generating public/private rkey pair.
Enter passphrase (empty for no passphrase):(直接回车)
Enter same passphrase again:
Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
Your public key has been saved in /etc/ssh/ssh_host_dsa_rey.pub.
key生成在目录/etc/ssh
没有.ssh目录的话手动创建,注意,它的目录权限是700
cat ssh_host_dsa_key.pub >> /root/.ssh/authorized_keys
ssh_host_dsa_rey这个放到客户端
/etc/ssh/sshd_config配置如下
Port 22
PubkeyAuthentication yes
AuthorizedKeysFile /root/.ssh/authorized_keys
PasswordAuthentication no /*禁止密码验证登录
重新登录。
SSH Secure File Transfer Client 无法登陆
原文:http://www.cnblogs.com/Baron-Lu/p/6298686.html