is it possible to change your script to join with RSA key connection with a password + specific username?
Could you clarify the question a bit? As I understood, you want the script to know which hosts use which usernames, passwords and keys, with same host having multitude of those?
sorry for my english:
I already changed your script to allow join only with RSA private key (on mikrotik is imported public):
add: k = paramiko.RSAKey.from_private_key_file('key.ppk')
this way allows you to connect to ssh only with the private ssh key - without login + password.
The problem occurs when I generate ssh (RSA) keys in PuttyGEN - the paramiko module reports a ssh key format error.
If I generate ssh keys over paramics, everything is fine.
Is it possible to add the ability to generate the most secure pairs of private and public keys compatible with mikrotik?
Probably RSA 4096 - with password (aes-128-ctr)
Signing in with ssh keys is a much safer method.
Thank you for the info.