操作系统:suse 10 sp2 64bit
fly007用户的SHELL为:csh
1、同事反映,使用sftp登入服务器时,报Received message too long 1114795883错误:
fly007.example.com:~ # sftp fly007@192.168.1.90 Connecting to 192.168.1.90... Password: Received message too long 1114795883
2、只有fly007用户存在这个问题,怀疑是fly007用户的环境设置问题,su – fly007没有任何的输出,
如果.cshrc,.bashrc,.profile文件中有一些cat,echo的输出,可能会导致这个问题,这是度娘的回复,
测试了下,确实是会出现这个问题,如下所示:
fly007.example.com:~ # su - csh haha fly007.example.com> echo $SHELL /usr/bin/csh fly007.example.com> cat .cshrc echo "haha" fly007.example.com> exit logout fly007.example.com:~ # sftp csh@192.168.1.90 Connecting to 192.168.1.90... Password: Received message too long 1751214177
3、问题基本可以确定在fly007的环境设置上是有问题的,因为sftp是ssh的子服务,scp也是,ssh是可
以正常登入的,且不报错的,su也是可以正常切换的,那么scp呢
fly007.example.com:~ # scp 1.txt fly007@192.168.1.90:/home/fly007 Password: stty: standard input: Invalid argument 1. txt 100%
4、问题基本可以确定了,设置的stty环境变量有问题
fly007.example.com:~ # su - fly007 fly007.example.com>echo $SHELL /usr/bin/csh fly007.example.com>cat .cshrc | grep stty stty erase "^H" kill "^U" intr "^C" eof "^D" susp "^Z" hupcl ixon ixoff tabs
5、注释stty环境变量
fly007.example.com>cat .cshrc | grep stty #stty erase "^H" kill "^U" intr "^C" eof "^D" susp "^Z" hupcl ixon ixoff tabs
6、执行scp和sftp,不再报错,问题解决
fly007.example.com:~ # scp 1.txt fly007@192.168.1.90:/home/fly007 Password: 1.txt 100% 0 0.0KB/s 00:00 fly007.example.com:~ # sftp fly007@192.168.1.90 Connecting to 192.168.1.90... Password: sftp>