title: paramiko exception for connection refused
body: <pre><code>import paramiko
  try:
      ssh =paramiko.SSHClient()
      ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
      ssh.connect(hostname='10.10.1.0',username='test',password='test1234')
      print 'Successfully connected'
  except paramiko.AuthenticationException:
      print "Authentication failed, please verify your credentials"
  except paramiko.SSHException as sshException:
      print "Unable to establish SSH connection: %s" % sshException
  </code></pre>
  
  <p>This is my code. It was working fine.
  If i give wrong userid and password - Perfectly throwing expection.</p>
  
  <p>But when hostname is not valid, it's throwing error as "Connection refused" and not sure what type of exception have to raise. Could some please help.</p>
  
  <p><strong>Error</strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 4, in &lt;module&gt;
    File "/usr/lib/python2.6/site-packages/paramiko/client.py", line 290, in connect
      sock.connect(addr)
    File "&lt;string&gt;", line 1, in connect
  socket.error: [Errno 111] Connection refused
  </code></pre>