1

Wednesday 21st July 2010

Local Packages

sftp fix

I've been having trouble connecting to my machine using sftp recently:

$ sftp roary
Received message too long 1650553704

The "Received message too long" error is usually due to having something in ~/.bashrc or ~/.bash_profile that generates output, which confuses sftp. After much experimentation, I tracked it down to /etc/profile.d/PackageKit.sh, which adds a command-not-found handler in bash, and somehow this was being invoked during the sftp login though I couldn't see any trace of it using regular ssh.

So the simplest fix for me was to just remove it:

# yum remove PackageKit-command-not-found

And lo, sftp worked again:

$ sftp roary
Connected to roary.
sftp>