linux远程传文件太慢,解决linux scp、ssh 登陆远程服务器连接速度慢
在使用scp時(shí)拷貝文件時(shí)建立連接非常慢。其實(shí)除了網(wǎng)絡(luò)原因,還有就是因?yàn)樵趕cp拷貝文件前會(huì)生成 認(rèn)證文件。
你可以用 -v 選項(xiàng)確認(rèn)你的情況. 例如, 下面是 ssh 的詳細(xì)登陸過程:
cherry@cherry:~$ ssh -v cherry@59.151.47.49
...
...
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
No credentials cache found
debug1: Unspecified GSS failure. Minor code may provide more information
No credentials cache found
debug1: Unspecified GSS failure. Minor code may provide more information
debug1: Next authentication method: publickey
debug1: Trying private key: /home/cherry/.ssh/identity
debug1: Trying private key: /home/cherry/.ssh/id_rsa
debug1: Trying private key: /home/cherry/.ssh/id_dsa
debug1: Next authentication method: password
1. 連接時(shí)用命令指定(推薦,理由看注釋):
ssh -o GSSAPIAuthentication=no cherry
2. 在 ssh 客戶端程序的配置文件里顯式禁用 GSSAPI 認(rèn)證. 如, 編輯 /etc/ssh/ssh_config 文件, 添加或修改使其有如下一行:
GSSAPIAuthentication no
3. 在用戶根目錄下的 .ssh 目錄下創(chuàng)建一個(gè) config 文件. 如, 編輯 /home/cherry/.ssh/config (如果該文件不存在, 則創(chuàng)建之), 添加選項(xiàng):
GSSAPIAuthentication no
[注] A. /etc/ssh/ssh_config 是全局配置文件, 對(duì)其進(jìn)行的修改會(huì)影響所有使用 ssh 客戶端的系統(tǒng)用戶. ? ? ? ? B. /home/cherry/.ssh/config 是只會(huì)影響用戶 xcl 的本地 ssh 客戶端配置文件. 該文件的所有配置參數(shù)會(huì)覆蓋全局配置文件的相同配置參數(shù).
總結(jié)
以上是生活随笔為你收集整理的linux远程传文件太慢,解决linux scp、ssh 登陆远程服务器连接速度慢的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 支付宝掌纹支付功能曝光,正在加速研发追赶
- 下一篇: linux系统原理是什么意思,Linux