1、在网上搜索了一下资料,导致这个问题的主要原因是GSSAPI认证。用scp -v username@host:file file这个命令时可以看到GSS这个过程耗时比较长。解决办法有两个。
2、用scp时加上-o GSSAPIAuthentication=no这个参数,如,scp scp -o GSSAPIAuthentication=nousername@host:file file
3、在$HOME/.ssh/config这个文件中加入下面这行参数。GSSAPIAuthentication no如图。