Force password authentication (ignore keys in .ssh folder) in Paramiko in Python
问题 I'm trying to write a small Python program to check whether an SSH server allows a password authentication. Here is the current plan: import base64 import paramiko client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect('ssh.example.com', username='strongbad', password='thecheat') stdin, stdout, stderr = client.exec_command('ls') for line in stdout: print('... ' + line.strip('\n')) client.close() The idea is to grep the output or to later put