部件相关人员反映,使用sftp登入服务器时,报如下错误:
station90.example.com:~ # sftp dota@192.168.15.90
Connecting to 192.168.15.90...
Password:
Received message too long 1114795883
1、因只有dota用户存在这个问题,故怀疑是dota用户的环境设置问题,su – dota没有任何的输出,如果.cshrc,.bashrc,.profile文件中有一些cat,echo的输出,可能会导致这个问题,这是百度得到的答案,测试了下,确实是会出现这个问题,如下所示:
station90.example.com:~ # su - csh
haha
station90.example.com> echo $SHELL
/usr/bin/csh
station90.example.com> cat .cshrc
echo "haha"
station90.example.com> exit
logout
station90.example.com:~ # sftp csh@192.168.15.90
Connecting to 192.168.15.90...
Password:
Received message too long 1751214177
2、问题基本可以确定在sag的环境设置上是有问题的,因为sftp是ssh的子服务,scp也是,ssh是可以正常登入的,且不报错的,su也是可以正常切换的,那么scp呢
station90.example.com:~ # scp 1.txt dota@192.168.15.90:/home/dota
Password:
stty: standard input: Invalid argument
- txt 100%
3、问题基本可以确定了,设置的stty环境变量有问题
station90.example.com:~ # su - dota
<51 station90.example.com:/home/dota>echo $SHELL
/usr/bin/csh
<52 station90.example.com:/home/dota>cat .cshrc | grep stty
stty erase "^H" kill "^U" intr "^C" eof "^D" susp "^Z" hupcl ixon ixoff tabs
4、注释stty环境变量
<54 station90.example.com>cat .cshrc | grep stty
#stty erase "^H" kill "^U" intr "^C" eof "^D" susp "^Z" hupcl ixon ixoff tabs
5、测试表明,问题解决
station90.example.com:~ # scp 1.txt dota@192.168.15.90:/home/dota
Password:
1.txt 100% 0 0.0KB/s 00:00
station90.example.com:~ # sftp dota@192.168.15.90
Connecting to 192.168.15.90...
Password:
sftp>
参考文档:
http://www.snailbook.com/faq/sftp-corruption.auto.html