免密scp解決ssh_exchange_identification:read connection reset by peer 原因
在區塊鏈docker映象轉移過程中,需要經常在伺服器之間拷貝資源,scp需要密碼很不方便,因此需要免密操作。以下是方法以及錯誤解決辦法。
1. 在伺服器 S 上執行如下命令來生成配對金鑰:
ssh-keygen -t rsa
按照提示操作,注意,不要輸入passphrase,因為我的之前已經操作過,所以還提示了是否覆蓋,輸入 "y"回車就可以。其他提示資訊如下
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
ff:8e:85:68:85:94:7c:2c:46:b1:e5:2d:41:5c:e8:9b root@localhost.domain
2. 將 /root/.ssh/ 目錄中的 id_rsa.pub 檔案複製到 伺服器 B 的 /root/.ssh/ 目錄中,並改名為 authorized_keys。
scp .ssh/id_rsa.pub root@192.168.0.2:/root/.ssh/authorized_keys
以後從伺服器 S scp 到伺服器 B 就不需要密碼了。
3、伺服器改了密碼,試過密碼多次後出現:
ssh_exchange_identification: read: Connection reset by peer
可以通過ssh -v檢視連線時詳情
OpenSSH_6.6.1, OpenSSL 1.0.1k-fips 8 Jan 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: Connecting to xxx [xx] port 22.
debug1: Connection established.
debug1: identity file /home/yanue/.ssh/id_rsa type -1
debug1: identity file /home/yanue/.ssh/id_rsa-cert type -1
debug1: identity file /home/yanue/.ssh/id_dsa type -1
debug1: identity file /home/yanue/.ssh/id_dsa-cert type -1
debug1: identity file /home/yanue/.ssh/id_ecdsa type -1
debug1: identity file /home/yanue/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/yanue/.ssh/id_ed25519 type -1
debug1: identity file /home/yanue/.ssh/id_ed25519-cert type -1
最後找打解決方法:
vi /etc/hosts.allow
追加:
sshd: ALL
重啟ssh就ok了
service sshd restart
相關文章
- go grpc: connection reset by peer 的一種解決方案GoRPC
- Connection reset by peer: socket write errorError
- java.io.IOException: Connection reset by peerJavaException
- Kubelet 錯誤日誌 broken pipe 和 connection reset by peer 的原因分析
- TNS-12547,Linux Error: 104: Connection reset by peerLinuxError
- TNS-12547 Linux Error: 104: Connection reset by peerLinuxError
- 連線華為雲的Redis服務報錯“Error: Connection reset by peer”RedisError
- scp時候出現ssh Connection refused的解決方案
- JMETER java.net.SocketException: Connection reset 報錯解決方案JMeterJavaException
- weblogic連線池重置(Connection reset)問題解決方案Web
- 【Azure Cache for Redis】Python Djange-Redis連線Azure Redis服務遇上(104, 'Connection reset by peer')RedisPython
- TNS-12547TNS-12560 TNS-00517 Linux Error: 104: Connection reset by peerLinuxError
- SSH免密登入與SCP遠端複製
- ssh問題:ssh_exchange_identification: Connection closed by remote hostIDEREM
- remount of /system failed: Read-only file system原因及解決REMAI
- ssh免密碼登入失敗解決密碼
- 如何scp不用密碼密碼
- 解決java connectionJava
- 【Azure Redis 快取】 Python連線Azure Redis, 使用redis.ConnectionPool 出現 "ConnectionResetError: [Errno 104] Connection reset by peer"Redis快取PythonError
- HttpClient遭遇Connection Reset異常,如何正確配置?HTTPclient
- 現代 CSS 解決方案:Modern CSS ResetCSS
- Sqoop從Oracle抽數錯:IO Error: Connection resetOOPOracleError
- scp出現錯誤的解決辦法
- GitHub不再支援密碼驗證解決方案:SSH免密與Token登入配置Github密碼
- SSH免密登入詳解
- 解決db file sequential read與db file scattered read
- SecureCRT連線CentOS不間斷出現“Connection was reset.”SecurecrtCentOS
- 從Connection Reset問題淺談DBCP的使用技巧薦
- linux之cp/scp命令+scp命令詳解Linux
- FTP Connection refused error 解決辦法FTPError
- 1 Million TCP Connection 問題解決TCP
- 解決Xmanager-AIX XDMCP Connection failedAI
- linux-scp 遠端拷貝報錯原因Linux
- ANR原因及解決方法
- 解決方案: scp/ssh 的登陸提示很慢 (Linux)Linux
- 記錄redis佇列read error on connection to錯誤Redis佇列Error
- Cannot get a connection, pool exhausted解決辦法
- ios開發證書reset原理分析以及解決方案iOS