Forum Discussion
Python code using Parallel-SSH library to connect to F5 BigIP
Hello,
I've tried mimicking the code shared here, but it returns a similar error
pssh.exceptions.AuthenticationError: ('Authentication error while connecting to %s:%s - %s - retries %s/%s', '<IP_address>', 22, AuthenticationError(), 3, 3
A difference I noticed is that my user, when connected through SSH, gets placed in TMSH instead of BASH.
I've tried
from pssh.clients import ParallelSSHClient
hosts = ['<IP_address1>', '<IP_address2>']
client = ParallelSSHClient(hosts, user='<MyUser>',password='<MyPassword>')
cmd = 'show sys clock'
output = client.run_command(cmd)
for host_out in output:
for line in host_out.stdout:
print(line)
and
from pssh.clients import SSHClient
host = '<IP_address>'
s = SSHClient(host, user='<MyUser>', password='<MyPassword>')
cmd='show system clock'
res = s.run_command(cmd)
print(res)
for line in res.stdout:
print(line)
Thanks in advance. All help will be appreciated.
My versions
- WSL, Ubuntu 22.04.4 LTS
- Python 3.10.12
- parallel-ssh 2.12.0
- ssh-python 1.0.0
- ssh2-python 1.0.0
- BIG-IP 15.1.10.3
I'm not able to get ssh2-python installed on either my intel or apple silicon mac currently, erroring out. Might be a little while before I can troubleshoot. I'm guessing since you're in the tmsh shell that this won't work as advertised.
- MISJul 03, 2024Nimbostratus
JRahm,
Thanks for your prompt response.
In my uneducated and unexperienced state, I was hoping it would work. In the end, it's just a command in the terminal, I thought.
If it's within my capabilities, I'll be glad to try anything you can suggest.
I'll see if I can make my user fall into BASH instead of TMSH when SSHing to the F5s.
Regards,
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com