When attempting to log in to a server via SSH using tools like Python's fabric or Paramiko, you may encounter an "Authentication (publickey) failed" error on specific servers.
There is an issue on the GitHub repository which has already been addressed:
https://github.com/paramiko/paramiko/issues/1915
This issue occurs when the server is running OpenSSH 8.8 or above and the client is using Paramiko 2.8.0 or below.
To check the Python version used by fabric (fab):
% head $(which fab)
#!/usr/local/opt/python@3.9/bin/python3.9
# -*- coding: utf-8 -*-
import re
import sys
from fabric.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
To update the version of Paramiko used by the Python instance for fabric:
% /usr/local/opt/python@3.9/bin/python3.9 -m pip install -U paramiko
Comments