Php and ssh woes using pty with proc_open on vserver

Recently I had to create an ssh module @ work to connect to our servers and send and recieve information using ssh and scp. However because we use vserver simply using proc_open() with all PTY descriptorspec wasn’t going to work. After about half a week of fiddling and stressing out over certain things and escalating the issue to the tech dude @ work. The Tech manager kicked the ball back saying there was probably a bug in vserver and that i had to learn to live with it…
So back to SSH…. the -t option should force pseudo-tty allocation…. after having tried that numerous times using normal pipes .. I gave up on it …and continued to work on the ssh module using PTY and had a fallback using the local shell for development.

Now the in the man pages for ssh it says “Multiple -t  options force tty allocation, even if ssh has no local tty.”…(thanks to Bert the tech manager for figuring that out)

So in essence “-t -t”  is another way of saying “YES I REALLY WANT A PSEUDO TERMINAL!!!!11oneone”

I’m just putting this out there so other people can benefit from this bit of pretty usefull information.

Things learnt:

  1. Read manual pages better
  2. Look for those “exception” rules and parameters.
  3. vserver has some limitations

Who the bleep comes up with this stuff….thats like “rebooting it three times

Thanks Bert for reading those flipping hard to read man pages and diving into the depths of vserver.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.