Interview Prep/Linux/SSH, sudo and authentication

SSH port forwarding fails with `channel 3: open failed: administratively prohibited: open failed`.

IntermediateTroubleshootingSSH, sudo and authentication
Answer

Likely causes → The server disallows TCP forwarding (AllowTcpForwarding no, PermitOpen restrictions), or the key has no-port-forwarding / restrict options in authorized_keys.

Diagnose →

sudo sshd -T | grep -Ei 'allowtcpforwarding|permitopen'
grep -n 'no-port-forwarding\|restrict' ~/.ssh/authorized_keys

Fix → If approved, enable forwarding for that user/group via Match blocks, or add a PermitOpen host:port allowlist.

Prevent → Document which roles may tunnel; forwarding is often deliberately disabled.

All Linux questions Roadmap: Linux

More on SSH, sudo and authentication