MobaXterm Python user and password

45 views Asked by At

I am trying to create a script that logs me into a machine throught Mobaxterm with python I am able to open Moba and log into the host with a specific username, but how do I automate the password as it currently prompts me to enter password

Here is the small code:

import subprocess
import time
moba_path = "C:\Program Files (x86)\Mobatek\MobaXterm\MobaXterm.exe"
output = subprocess.Popen(f'{moba_path} -newtab "ssh -t -l usernameEXP 122.30.218.12 "', shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)

So I am able to open moba to host 122.30.218.12 with user usernameEXP so i get [email protected]'s password:

How do i enter the password with python

Automatically log into the SSH server with user and password

0

There are 0 answers