在网上搜索了一下资料,导致这个问题的主要原因是GSSAPI认证。用scp -v username@host:file file这个命令时可以看到GSS这个过程耗时比较长。解决办法有两个。
scp连接缓慢的解决方法
1、用scp时加上-o GSSAPIAuthentication=no这个参数,如, scp scp  -o GSSAPIAuthentication=no username@host:file file



ssh连接缓慢的解决方法
2、在$HOME/.ssh/config这个文件中加入下面这行参数。
GSSAPIAuthentication no