Operating System: SUSE 10 sp2 64bit
Bkjia user's SHELL is: csh
1. My colleagues reported that when using sftp to log on to the server, the following error occurs:
Bkjia.example.com :~ # Sftp bkjia@192.168.1.90
Connecting to 192.168.1.90...
Password:
Received message too long 1114795883
2. This problem exists only for bkjia users. It is suspected that the bkjia user's environment is faulty, and su-bkjia does not have any output,
If the. cshrc,. bashrc, And. profile files contain some cat and echo output, this problem may occur,
After testing, this problem occurs, as shown below:
Bkjia.example.com :~ # Su-csh
Haha
Bkjia.example.com> echo $ SHELL
/Usr/bin/csh
Bkjia.example.com> cat. cshrc
Echo "haha"
Bkjia.example.com> exit
Logout
Bkjia.example.com :~ # Sftp csh@192.168.1.90
Connecting to 192.168.1.90...
Password:
Received message too long 1751214177
3. The problem is basically confirmed that there is a problem with the bkjia environment settings, because sftp is a sub-service of ssh, scp is also, and ssh is
If you log on normally and do not report an error, you can switch between su and scp.
Bkjia.example.com :~ # Scp 1.txt bkjia@192.168.1.90:/home/bkjia
Password:
Stty: standard input: Invalid argument
1. txt 100%
4. The problem is fixed. The stty environment variable is incorrect.
Bkjia.example.com :~ # Su-bkjia
Bkjia.example.com> echo $ SHELL
/Usr/bin/csh
Bkjia.example.com> cat. cshrc | grep stty
Stty erase "^ H" kill "^ U" intr "^ C" eof "^ D" susp "^ Z" hupcl ixon ixoff tabs
5. Comment out stty Environment Variables
Bkjia.example.com> cat. cshrc | grep stty
# Stty erase "^ H" kill "^ U" intr "^ C" eof "^ D" susp "^ Z" hupcl ixon ixoff tabs
6. Execute scp and sftp. No error is reported and the problem is solved.
Bkjia.example.com :~ # Scp 1.txt bkjia@192.168.1.90:/home/bkjia
Password:
1. txt 100% 0 0.0KB/s
Bkjia.example.com :~ # Sftp bkjia@192.168.1.90
Connecting to 192.168.1.90...
Password:
Sftp>