免密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
- Kubelet 錯誤日誌 broken pipe 和 connection reset by peer 的原因分析
- ‘OpenSSL SSL_read: Connection was reset, errno 10054’
- 連線華為雲的Redis服務報錯“Error: Connection reset by peer”RedisError
- 阿里雲站點升級提示:OpenSSL SSL_connect: Connection reset by peer in connection to www.pbootcms.com:443阿里boot
- JMETER java.net.SocketException: Connection reset 報錯解決方案JMeterJavaException
- scp的免密登入方式
- 【Azure Cache for Redis】Python Djange-Redis連線Azure Redis服務遇上(104, 'Connection reset by peer')RedisPython
- 【Azure Redis 快取】 Python連線Azure Redis, 使用redis.ConnectionPool 出現 "ConnectionResetError: [Errno 104] Connection reset by peer"Redis快取PythonError
- remount of /system failed: Read-only file system原因及解決REMAI
- SSH免密登入與SCP遠端複製
- ssh免密碼登入失敗解決密碼
- HttpClient遭遇Connection Reset異常,如何正確配置?HTTPclient
- Sqoop從Oracle抽數錯:IO Error: Connection resetOOPOracleError
- OpenWrt 無法透過 ssh 免密碼方式訪問 git 伺服器的原因及解決方案密碼Git伺服器
- Java中處理SocketException: Connection reset”異常的方法JavaException
- 記錄redis佇列read error on connection to錯誤Redis佇列Error
- 現代 CSS 解決方案:Modern CSS ResetCSS
- GitHub不再支援密碼驗證解決方案:SSH免密與Token登入配置Github密碼
- linux-scp 遠端拷貝報錯原因Linux
- SSH免密登入詳解
- oracle OGG-01232 Receive TCP params error:TCP/IP error 232(connection reset)OracleTCPError
- 解決 Android studio Connect to 127.0.0.1:[/127.0.0.1] failed: Connection refusedAndroid127.0.0.1AI
- LLM-kimi-HTTP read timeout常見原因HTTP
- Mysql host is blocked because of many connection errors;unblock解決方法MySqlBloCError
- 轉載---IDirect3DDevice9::Reset 失敗的原因3Ddev
- 阿里雲 Redis 報出You can't read against a non-read redis.解決方案阿里RedisAI
- SAP:CX_SY_READ_SRC_LINE_TOO_LONG解決
- Linux的scp命令詳解Linux
- 解決docker jenkins 配置SSH免密登入配置成功後不生效問題DockerJenkins
- [轉]Android Studio匯入工程報錯 Error:Cause: peer not authenticated 解決方案AndroidError
- 解決問題-There appears to be trouble with your network connection. Retrying...APP
- Mysql mysql lost connection to server during query 問題解決方法MySqlServer
- Error establishing a database connection 的解決方法(發現黑客入侵)ErrorDatabase黑客
- 異常解決——GitLab : ssh: connect to host port 22: Connection refusedGitlab
- FileZilla:425 Can't open data connection for transfer of解決辦法
- 跨域的原因以及解決方案跨域
- java.net.SocketTimeoutException: Read timed out異常解決方法JavaException