SSH quick fixes

By Niraj Zade  |  2023 Jul 09  |  0m read


Usual issues:

  1. Your key doesn't have restricted permissions, so openssh refuses to use it.
  2. You specified a non-existent key in the ssh config

Set proper permissions

# permission of the ssh dir itself
chmod 700 ~/.ssh/
# baseline permissions for all files in ssh dir
chmod 600 ~/.ssh/*
# set more open permissions for public keys in the ssh dir
chmod 644 ~/.ssh/*.pub

Debug ssh connection issues

  • ssh -v <host> – issues on your end (client)
  • ssh -vv – good enough logs of both client and server side
  • ssh -vvv – detailed logs from both client and server
ssh -vT <hostname>
v: verbose
T: Disable pseudo-terminal allocation

Eg: Debug why git via ssh isn't working:

ssh -vT [email protected]

Other Articles

© Niraj Zade 2025 - Website, Linkedin
Website was autogenerated on 2025-12-01
Whoever owns storage, owns computing | Silicon is this generation's atomics