Hi all,
I'm trying to learn about capabilities of Python to work on remote servers. For my setup I have local ServerA and remote ServerB, I need to run py on ServerB to get some output files. There is no any option to do it from anywhere else as it custom setup for security purposes, I only can run it from ServerB. They both are W boxes. Server B is totally isolated from network.
But for control and scheduling purposes I would like to operate on local ServerA. And for first step I tried to work with Paramiko to fire ServerB.test.py
And I'm getting error like below, I suspect it could be due the fact that I have very uncommon syntax for my account with backslash?
Appreciate your help, excited to learn python and make my first post.
Best
Mario
I'm trying to learn about capabilities of Python to work on remote servers. For my setup I have local ServerA and remote ServerB, I need to run py on ServerB to get some output files. There is no any option to do it from anywhere else as it custom setup for security purposes, I only can run it from ServerB. They both are W boxes. Server B is totally isolated from network.
But for control and scheduling purposes I would like to operate on local ServerA. And for first step I tried to work with Paramiko to fire ServerB.test.py
And I'm getting error like below, I suspect it could be due the fact that I have very uncommon syntax for my account with backslash?
# Server connection details
hostname = 'xServerB'
username = 'rdc\\twil100' # added extra \ for escape, original only single \
password = 'pswd123'
try:
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname, username=username, password=password) # error here
command = 'print(\'ServerB\')
stdin, stdout, stderr = client.exec_command(command)
except Exception as e:
print('Exc 3')
print(f"An unexpected error occurred: {e}")
####################
An unexpected error occurred: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respondit takes more then 5 sec to get this error, so I assume it's just timeout. I tried to work with login name with and without escape \, no differences, even with bad password output is the same. I't failing on client.connect step.Appreciate your help, excited to learn python and make my first post.
Best
Mario
