赞
踩
本文旨在为广大SSH用户提供一个全面而实用的使用问题汇总。我们将深入探讨SSH连接失败、密钥管理、权限设置等常见难题,并提供详细的解决方案。通过本文,您将能够轻松应对SSH使用过程中遇到的各类问题,提升SSH操作效率,保障远程连接的安全性。无论您是SSH初学者还是资深用户,相信本文都能为您提供有价值的参考和帮助。
ssh到server时报如下错误
ssh_exchange_identification: read: Connection reset by peer
vim /etc/hosts.allow
添加
sshd : ALL
重启ssh服务
service sshd restart
vim /etc/hosts.deny
把中含客户端IP的删除掉试试
重启ssh服务
service sshd restart
ssh: connect to host XX.XX.XX.XX port 22: Connection refused
ps -ef|grep sshd
- root 2859 1 020:29 ? 00:00:00 /usr/sbin/sshd -D
-
- root 2901 2859 020:31 ? 00:00:00 sshd: june[priv]
-
- june 2971 2901 020:31 ? 00:00:00 sshd:june@pts/1
其中/usr/sbin/sshd为ssh clinet/server中server端的守护进程,如果上述结果中没有sshd出现,那么可能就是你的server端程序没有安装,或者sshd服务没有启动
sudo iptables -L
- Chain INPUT (policy ACCEPT)
-
- target prot opt source destination
-
- ACCEPT tcp – anywhere anywhere tcp dpt:ssh
-
- Chain FORWARD (policy ACCEPT)
-
- target prot opt source destination
-
- Chain OUTPUT (policy ACCEPT)
-
- target prot opt source destination
SSL_connect: SSL_ERROR_SYSCALL in connectiontogithub.com:443
一般因为开了代理
git config --global --unset http.proxy
sudo vim /etc/ssh/sshd_config
找到PasswordAuthentication
将PasswordAuthentication no改为yes,保存
接着使用命令:
sudo service ssh restart
The following method might work if you can access machineA and machineB independently (e.g. from machineC).
If ssh-copy-id is not working, password authentication could be disabled. The following is a workaround.
Having machineA's public key in machineB's authorized keys (i.e. ~/.ssh/authorized_keys) will allow you to ssh from machineA. This also applies to scp.
After generating the key pairs using: ssh-keygen
On machineA, execute cat ~/.ssh/id_rsa.pub
Sample output:
ssh-rsa AAAAB3NzaSGMFZW7yB anask@mahineA
Copy the printed key (⌘ Command+C, or CRTL+C) then add it to the ~/.ssh/authorized_keys file on machineB.
For example, execute the following on machineB:
echo 'ssh-rsa AAAAB3NzaSGMFZW7yB anask@mahineA' >> ~/.ssh/authorized_keys
SSH登录提示:connection refused的解决办法_ABC_ORANGE的博客-CSDN博客
教你如何调试 SSH 连接
使用ssh远程连接服务器Permission denied (publickey). 解决方法_ssh publickey denied_IT鹅的博客-CSDN博客
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。