> ## Content Index
> Fetch the complete content index at: https://www.aktheknight.co.uk/llms.txt
> Use this file to discover other available public pages before exploring further.

# Setting correct permissions for the ./ssh folder on Ubuntu
- URL: https://www.aktheknight.co.uk/setting-correct-permissions-for-ssh-on-ubuntu/
- Published: 2020-05-25T00:12:42.000Z
- Updated: 2020-05-25T00:12:42.000Z
- Author: Alex Knight
- Tags: linux, ssh, #Import 2026-08-20 09:17

Because I am often setting up servers for testing, and fiddling around with SSH keys, I often get confronted with the error '*Permissions 0664 for '/home/alex/.ssh/id\_rsa' are too open'.*

![Screenshot showing the 'Permissions are too open error'](https://www.aktheknight.co.uk/content/images/2020/05/image.png)

Screenshot showing the 'Permissions are too open error'

This error is, as suggested, caused by permissions being incorrect for the id\_rsa private key file used for SSH. Fixing the permissions will cause SSH to then work correctly.

To save me from always struggling to find the permissions, I've decided to just post them here as a reference to myself.

```bash
chmod 700 ~/.ssh
chmod 644 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts
chmod 644 ~/.ssh/config
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
```

Commands to set permissions properly