`Failed to connect to the host via ssh: channel 0: open failed: administratively prohibited` when using a bastion
AdvancedTroubleshootingConnection and SSH Failures
Answer
Likely causes → The bastion's sshd has AllowTcpForwarding no or PermitOpen restrictions, which block ProxyJump or ProxyCommand with -W.
Diagnose → ssh -vvv -J bastion target and inspect the bastion's sshd_config.
Fix → Allow TCP forwarding for the automation user on the bastion (AllowTcpForwarding yes or a Match User block), or use SSM Session Manager.
Prevent → Include the jump requirements in the bastion build.
More on Connection and SSH Failures
`UNREACHABLE! => {"msg": "Failed to connect to the host via ssh: Permission denied (publickey,password)."}`Beginner`UNREACHABLE! => {"msg": "Failed to connect to the host via ssh: ssh: connect to host 10.0.1.15 port 22: Connection timed out"}`Beginner`UNREACHABLE! => {"msg": "Failed to connect to the host via ssh: ssh: connect to host web01 port 22: Connection refused"}`Beginner`Host key verification failed.` after rebuilding a serverBeginnerThe playbook hangs for ever at "Gathering Facts" on one hostIntermediate`Failed to connect to the host via ssh: Too many authentication failures`Intermediate