Friday, May 02, 2008

SFTP and the Received message too long 1534226287 in a VPS

One of my clients, whom I act as a trainer and an admin, had an issue recently regarding the sftp. He created a vps (Lxlabs' HyperVM) named testvm with vpsid 120. The main hardware node IP be 192.168.0.1 . And the VPS IP be 192.168.0.101. He was trying to sftp testvm@192.168.0.1.

sftp testvm@192.168.0.1 was failing giving the message "Received message too long 1534226287" ;

It was a bit confusing for me, since it was a VPS and the shell assigned was /usr/bin/lxopenvz and I was not sure of the proper rc file it reads before switching the control to the vps. All I know was the shell is not verifying whether the $TERM is dump or not. And 1534226287 was translated to [roo (Decimal --> HEX --> ASCII)

So it was PS1 which is polluting the sftp stream. Spent 1 hour or so figuring out how to make it check the value of $TERM. And it was then I thought of trying the sftp root@192.168.0.101 (the VPS IP) and that worked. haha..

Client only needed to sftp to the VPS. He was not specific about sftping to root@VPS_IP or testvm@HN_IP. Spent one hour for just because of my absent mindedness. I should be more smart :-P