執行sftp命令時報Received message too long 1114795883

      操作系統:suse 10 sp2 64bit
      fly007用戶的SHELL爲:csh
1、同事反映,使用sftp登入服務器時,報Received message too long 1114795883錯誤:

fly007.example.com:~ # sftp [email protected]
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 [email protected]
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 [email protected]:/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 [email protected]:/home/fly007
Password:
1.txt                                                     100%    0     0.0KB/s   00:00
fly007.example.com:~ # sftp [email protected]
Connecting to 192.168.1.90...
Password:
sftp>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章