I\'m attempting to use Paramiko (on Python 2.7) to connect to a host that uses multifactor authentication (username + password + one-time-password). The transport.auth
A more convenient way is the auth_interactive_dumb method. it is an auth_interactive that just outputs what the server asks to the console and sends back what you type. This way you dont have to store the password and dont have to write your own handler.
so basically
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("mfahost.example.com", 22))
ts = paramiko.Transport(sock)
ts.start_client(timeout=10)
ts.auth_interactive_dumb(user)