---
title: "Unable to login using public key authentication"
date: "2014-12-08"
category: "terminal"
slug: "unable-login-using-public-key-authentication"
---

If public key authentication fails when connecting via SSH, the most common cause is incorrect file permissions.

## Verify Permissions

Ensure the following [[permissions-overview]] are set correctly:

- `~/.ssh/` directory: **700** (owner: read/write/execute, group: none, other: none)
- `~/.ssh/authorized_keys` file: **600** (owner: read/write, group: none, other: none)

You can fix permissions with:

```
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
```

## Verify Your Public Key

If permissions are correct, confirm that your public key is listed in `~/.ssh/authorized_keys`. The key in this file must match the private key your SSH client is using to connect.

## See Also

[[permissions-overview]]
