Skip to content

Fix SSH "Bad owner or permissions" errors (the right chmod for ~/.ssh) — by Robert on Server Fault

beginnerforumCC BY-SA (Stack Exchange; version depends on post date)

SSH refuses config and key files that other users could read or write. The answer sets the config to 600, checks the files belong to you, and includes a table of the correct permissions for the .ssh folder (700), private keys (600) and other files.

Quick steps

  1. chmod 700 ~/.ssh
  2. chmod 600 ~/.ssh/config ~/.ssh/id_* (private keys)
  3. chown $USER ~/.ssh/config

Paraphrased from the source. Menus can differ by version, so check the original for full details.

Read the full thread on serverfault.com

Source: Fix SSH "Bad owner or permissions" errors (the right chmod for ~/.ssh) by Robert on Server Fault. Licence: CC BY-SA (Stack Exchange; version depends on post date).

Source reviewed
2026-11-02
Link checked
Not yet
Tested hands-on
Not by Oddbyte.Me

sshpermissionschmodkeys

More in Community Answers (Stack Exchange)