Authentication
Password authentication
def execute_ssh_with_password(self, cmd, hostname, username, password)
SSH to a remote server and run a command. password must be specified as a parameter:
def get_data(self, textkey, option, instance_id, hostname, device_type, device_sub_type, tags, attributes):
return_code, stdout_output, stderr_output = self.execute_ssh_with_password("some command", hostname, "username", "password")
def execute_ssh_with_secret_password(self, cmd, hostname, username, repo="local")
SSH to a remote server and run a command. password will be retrieved from the local repo based on username and hostname:
def get_data(self, textkey, option, instance_id, hostname, device_type, device_sub_type, tags, attributes):
return_code, stdout_output, stderr_output = self.self.execute_ssh_with_secret_password( "some command", hostname, "username")
Secret management framework
You can also securely store your passwords encrypted in local storage. For more information, see Secret management framework.