Skip to content Skip to sidebar Skip to footer

Python - How Do I Authenticate SSH Connection With Fabric Module?

I'm trying to SSH into a Raspberry Pi on a subnet via ethernet using the Fabric module but I can't figure out how to authenticate the connection. My code so far is as follows impor

Solution 1:

Okay, it looks like you can pass options to the Connection constructor that will be passed on to SSHClient.connect

c = fabric.Connection("192.168.3.151", port=22, user="pi", connect_kwargs={'password': 'raspberry'})

Note it's generally a bad idea to store your passwords in plain text, especially in code.

See http://docs.fabfile.org/en/2.1/concepts/authentication.html as well as http://docs.fabfile.org/en/2.1/concepts/configuration.html


Post a Comment for "Python - How Do I Authenticate SSH Connection With Fabric Module?"