`Failed to connect to the host via ssh: Bad owner or permissions on /home/user/.ssh/config`
BeginnerTroubleshootingConnection and SSH Failures
Answer
Likely causes → SSH rejects config or key files that are group/world writable or owned by someone else.
Diagnose → ls -la ~/.ssh and ssh -vvv host.
Fix →
chmod 700 ~/.ssh && chmod 600 ~/.ssh/config ~/.ssh/id_*
chown -R "$USER": ~/.ssh
Prevent → Do not mount .ssh from shared volumes with loose permissions into containers.
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