Bah! Not able to sftp! But ssh works! WTF!
Wasnt able to sftp (filezilla, winsftp, sftpdrive, all fail) to my linux box, but was able to ssh like normal. SFTP gives weird error “Received message too long “. Realized the fucking bashrc/profile.d causing this issue. When ssh starts up the sftp subagent the shell must be clean, else the sftp may fail with error like this.
#sftp from localbox.
g@utam-f9:/temp $ sftp -v root@localhost
Connecting to localhost…
OpenSSH_5.0p1, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: Connection established.
debug1: identity file /data/home/g/.ssh/id_rsa type 1
….
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending subsystem: sftp
Received message too long 167772160
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.0 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 0
A quick inspection reveals, few lines in my bashrc are using colors to echo out some funky message, whenever I login to root. So a quick work around :)
if [ ${TERM} != “dumb” ]; then
cowsay -s Hey man, you are ROOT now! Careful! > ~/_cowsay.txt
dialog —title ‘ROOT!’ —textbox ~/_cowsay.txt 16 45
fi
ZOMG SuckCess!!!!
g@utam-f9:/temp $ sftp -v root@localhost
Connecting to localhost…
OpenSSH_5.0p1, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
…
debug1: Next authentication method: publickey
debug1: Offering public key: /data/home/g/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Offering public key: /data/home/g/.ssh/id_dsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: password
root@localhost’s password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending subsystem: sftp
sftp>