不久前遇到一个很诡异的问题,SSH很快,scp巨慢,查了很久没查出根源所在,几乎崩溃。幸好今天tonnyom找到了答案,哈哈,太强大了!!
2.9 - sftp/scp fails at connection, but ssh is OK.
sftp and/or scp may fail at connection time if you have shell initialization (.profile, .bashrc, .cshrc, etc) which produces output for non-interactive sessions. This output confuses the sftp/scp client. You can verify if your shell is doing this by executing:
ssh yourhost /usr/bin/true
If the above command produces any output, then you need to modify your shell initialization.
发现在.bashrc里面因为程序员需要在secureCRT上显示标签,加入了:
echo -ne "/e]2;${USER}@${HOSTNAME}/a"
去掉一切OK。
但是使用secureCRT又需要标签的同志是无法忍受的,因此设置的方法改为:
在/etc/sysconfig/bash-prompt-default里面加入:
echo -ne "/e]2;${USER}@${HOSTNAME}/a"
SSH很快,scp巨慢的问题
最新推荐文章于 2024-07-26 11:37:10 发布