ssh problem using paramiko?
Steve Holden
steve at holdenweb.com
Tue Oct 7 20:46:09 EDT 2008
sa6113 wrote:
> I use this code :
>
>
> import paramiko
> import socket
>
> hostname = "192.168.1.4"
> username = "test"
> port = 22
> password = ''123456"
>
> # now connect
> try:
> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> sock.connect((hostname, port))
> except Exception, e:
> print 'Connect failed: ' + str(e)
> traceback.print_exc()
> sys.exit(1)
>
> ------------------
> and I got this error :
> sock.connect((hostname, port))
> File "<string>", line 1 , in connect
> error:(10061 ,'Connection refused')
> -------------------
> what is the problem?
> I have a computer with this Ip and username , password in my network.
> Do I have to install ssh or somthing else in that computer(server) or run
> any script?
>
>
Yes, 192.168.1.4 should have an ssh daemon (normally sshd) running and
listening on port 22. It's fairly easy software to install.
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
More information about the Python-list
mailing list