1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Force PEM SSH keys for paramiko

Trying to get ansible-test working on my fedora-28 system, I noticed I
was getting invalid keys from paramiko. It looks like this is because
ssh-keygen is now defaulting to RFC4716 format for private / public
keys.

For now, we can still use PEM based SSH keys, but the long term fix here
is to report a bug to paramiko and support RFC4716 for rsa keys.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2018-09-18 13:55:52 -04:00 committed by Matt Clay
parent c0546b4133
commit e844bfe1d4

View file

@ -542,7 +542,7 @@ class SshKey(object):
make_dirs(base_dir)
if not os.path.isfile(key) or not os.path.isfile(pub):
run_command(args, ['ssh-keygen', '-q', '-t', 'rsa', '-N', '', '-f', key])
run_command(args, ['ssh-keygen', '-m', 'PEM', '-q', '-t', 'rsa', '-N', '', '-f', key])
if not args.explain:
shutil.copy2(key, self.key)