Skip to content

Commit 6dcfd15

Browse files
committed
docs: add FAQ entry for RHEL 9 crypto policy blocking ssh-rsa in EEs
Cisco IOS devices require ssh-rsa which RHEL 9 system crypto policy blocks at the libssh C library level. Document the root cause and the execution-environment.yml fix using a custom crypto sub-policy. Made-with: Cursor
1 parent a0c310f commit 6dcfd15

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

docs/faq.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,35 @@ Installing 'amazon.aws:3.1.1' to '/Users/sean/.ansible/collections/ansible_colle
181181
amazon.aws:3.1.1 was installed successfully
182182
```
183183

184+
## Problem: Cisco SSH fails with PUBLICKEY_ACCEPTED_TYPES error in AAP / Execution Environments on RHEL 9
185+
186+
```
187+
fatal: [rtr1]: FAILED! => {"changed": false, "msg": "ssh connection failed: Failed to authenticate public key: The key algorithm 'ssh-rsa' is not allowed to be used by PUBLICKEY_ACCEPTED_TYPES configuration option"}
188+
```
189+
190+
This affects any Execution Environment built on a RHEL 9 base image (e.g. `ee-supported-rhel9`, `ee-minimal-rhel9`). Older network devices like Cisco IOS only support the `ssh-rsa` key algorithm, but RHEL 9's system-wide crypto policy blocks `ssh-rsa` at the OS level inside the container.
191+
192+
**Why common fixes don't work:** Setting `ansible_libssh_publickey_algorithms`, `[libssh_connection]` in `ansible.cfg`, or the `ANSIBLE_LIBSSH_PUBLICKEY_ALGORITHMS` environment variable will NOT fix this. The rejection happens in the system `libssh` C library which reads `/etc/crypto-policies/back-ends/libssh.config` — below the Ansible layer entirely.
193+
194+
### Solution:
195+
196+
Add a custom crypto sub-policy to your `execution-environment.yml` that re-enables `ssh-rsa` for SSH only:
197+
198+
```yaml
199+
additional_build_steps:
200+
append_final:
201+
- RUN printf '[libssh]\npubkey_algorithms = +ssh-rsa\n[openssh]\nPubkeyAcceptedAlgorithms = +ssh-rsa\nHostKeyAlgorithms = +ssh-rsa\n' > /etc/crypto-policies/policies/modules/ANSIBLE-SSH-RSA.pmod && update-crypto-policies --set DEFAULT:ANSIBLE-SSH-RSA
202+
```
203+
204+
Rebuild and push the EE image. You can verify the fix by checking:
205+
206+
```
207+
podman run --rm <ee-image> cat /etc/crypto-policies/state/current
208+
# Should show: DEFAULT:ANSIBLE-SSH-RSA
209+
```
210+
211+
**Note:** Setting `ansible_network_cli_ssh_type=paramiko` on Cisco hosts can work as a temporary workaround since paramiko is pure Python and bypasses the system crypto policy, but it may cause credential injection issues in AAP.
212+
184213
## Getting Help
185214

186215
Please [file issues on Github](https://github.com/ansible/workshops/issues). Please fill out all required information. Your issue will be closed if you skip required information in the Github issues template.

0 commit comments

Comments
 (0)