Skip to content

Fix PEM formatting bug when loading private SSH keys in _get_pkey_object #6338

@amritupreti

Description

@amritupreti

Summary

When providing RSA private keys (especially in single-line format or missing proper PEM line breaks), the _get_pkey_object method fails with paramiko.SSHException, even for valid keys.

Environment

  • StackStorm version: 3.8.1
  • Affected component: st2common/st2common/runners/paramiko_ssh.py key parsing
  • Python version: 3.8
  • OS: Ubuntu 24.04.1

Steps to Reproduce

  1. Use an inline RSA private key with no line breaks, such as from an environment variable or API POST.
  2. Execute an SSH action.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions