一、经常远程链接 阿里云 ECS 服务器 ,遇到如下问题:
- git clone … 慢
- curl -L http:// … 慢
- wget http:// … 慢
二、快速提升下载速度:
在 ECS中,下载开源仓库的包,速度特别慢,通常维持在 10k/s 左右;是不是头痛欲裂,来,来,来,下载速度(git clone/wget/curl)有效提升100倍(由KB到MB),请按如下操作:
vim /etc/ssh/ssh_config
目标:找到 GSSAPIAuthentication no 这行,删掉前面的注释 “#” 号,然后保存退出
# Host *
# ForwardAgent no
# ForwardX11 no
# RhostsRSAAuthentication no
# RSAAuthentication yes
# PasswordAuthentication yes
# HostbasedAuthentication no
GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# GSSAPIKeyExchange no
# GSSAPITrustDNS no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
# IdentityFile ~/.ssh/id_ecdsa
# IdentityFile ~/.ssh/id_ed25519
# Port 22
# Protocol 2
# Cipher 3des
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
三、检验成果:
- 没有配置前,链接都超时,何谈下载;即使连上下载速度在KB;
- 修改/etc/ssh/ssh_config后,速度可达MB,亲测有用
- 建议,用完之后,将参数再修改回去,安全可靠,防止系统漏洞攻击