PDA

View Full Version : FYI: sshd-ftp issue with bash shell


happyfunball
06-08-2007, 12:13 AM
I ran into this problem when setting up my VPS and thought I'd document it here in case it saves someone a future headache. Its pretty awful and took hours to figure out.

Sometime in the afternoon I installed the old 'fortune' command which I remember from my school days working in unix. I added it to the end of .bashrc so that the fortune command displays a funny quote when I log in. Harmless right?

It turns out that everything works fine, except for sshd-ftp, which I use when deploying my php source code from MSDEV to my website.

After much head-scratching I tracked it down to the fortune command by retracing my steps and removing everything I had done. The command sends text that sshd-ftp is just not expecting. The error was something like 'key too long'.

Somehow monty python quotes were being interpreted as SSL/TSL encryption keys!

This error could come up with any program that generates text inside a logon script and only seems to screw up ssh-ftp, not ssh.

Rick
06-08-2007, 12:16 AM
ya, frustrating problem. same thing happens when people set a MOTD and use rsync. rsync doesnt know what to do with that output. since sftp and rsync aren't interactive protocols (and they are tunnelled over a normally interactive protocol), sftpd/rsync doesn't know what to do with that extra data, and goes bananas- its difficult to troubleshoot because the application itself, rsync/sftp, will treat it as a general failure as it has no way to deal with the specific problem (it shouldnt happen).