0

Instead of directly connecting to SSh client I have to connect using proxy server and then to ssh client?

I have tried below approach: in Boto\manage\cmdshell.py I have made below change

  while retry < 5:
            try:print "connecting ssh client"
                proxy = paramiko.ProxyCommand('connect-proxy -S my_proxy_IP:8080')      
                self._ssh_client.connect(self.server.hostname,
                                         username=self.uname,
                                         pkey=self._pkey,sock=proxy)

which is giving me File "C:\Python27\lib\site-packages\paramiko\transport.py", line 465, in start_client raise e paramiko.SSHException: Error reading SSH protocol banner

I referered this link here in stackoverflow Paramiko Error: Error reading SSH protocol banner where they are saying

answer is

This issue didn't lie with Paramiko, Fabric or the SSH daemon. It was simply a firewall configuration in ISPs internal network. For some reason, they don't allow communication between different subnets of theirs. We couldn't really fix the firewall configuration so instead we switched all our IPs to be on the same subnet.

but in my case my host is amazonaws instance what should i do in that case.

I am doing anything wrong here or how can i ovecome this issue.

Community
  • 1
  • 1
sagar
  • 1,375
  • 5
  • 20
  • 38

1 Answers1

2

Fabric has this available as an option by default since version 1.5, documented here. If you're unable to use Fabric, you might then crib from it's source a better solution for yourself.

Morgan
  • 4,143
  • 27
  • 35
  • Thanks Morgan for your reply..This is one of the thing i am looking for long time.. I am using fabric 1.4.3 flavor now I will update it.Currently I am busy in other stuff.I will check and let you know my result once I got chance. – sagar Jan 17 '14 at 10:31
  • Cool, you can always use a virtual env to test updates on commands. I find it nice to not upgrade the global if i am unsure – Morgan Jan 17 '14 at 16:15