Authentication documentation
Keep your account and data secure with features like two-factor authentication, SSH, and commit signature verification.
Start here
Generating a new SSH key and adding it to the ssh-agent
After you've checked for existing SSH keys, you can generate a new SSH key to use for authentication, then add it to the ssh-agent.
Managing your personal access tokens
You can use a personal access token in place of a password when authenticating to GitHub in the command line or with the API.
Configuring two-factor authentication
You can choose among multiple options to add a second source of authentication to your account.
Popular
Troubleshooting SSH
When using SSH to connect and authenticate to GitHub, you may need to troubleshoot unexpected issues that may arise.
Checking for existing SSH keys
Before you generate an SSH key, you can check to see if you have any existing SSH keys.
Adding a new SSH key to your GitHub account
To configure your account on GitHub.com to use your new (or existing) SSH key, you'll also need to add the key to your account.
Authenticating with single sign-on
You can authenticate to GitHub with single sign-on (SSO) and view your active sessions.
Recovering your account if you lose your 2FA credentials
If you lose access to your two-factor authentication credentials, you can use your recovery codes, or another recovery option, to regain access to your account.
Error: Permission denied (publickey)
A "Permission denied" error means that the server rejected your connection. There could be several reasons why, and the most common examples are explained below.
Creating a strong password
Secure your account on GitHub with a strong and unique password using a password manager.
Keeping your account and data secure
- About authentication to GitHub
- Creating a strong password
- Switching between accounts
- Verifying new devices when signing in
- Updating your GitHub access credentials
- Managing your personal access tokens
- Reviewing your SSH keys
- Reviewing your deploy keys
- Token expiration and revocation
- Reviewing your security log
- Security log events
- Removing sensitive data from a repository
- About anonymized URLs
- About GitHub's IP addresses
- GitHub's SSH key fingerprints
- Sudo mode
- Preventing unauthorized access
- Viewing and managing your sessions
Securing your account with two-factor authentication (2FA)
- About two-factor authentication
- Configuring two-factor authentication
- Configuring two-factor authentication recovery methods
- Accessing GitHub using two-factor authentication
- Recovering your account if you lose your 2FA credentials
- Changing your two-factor authentication method
- About mandatory two-factor authentication
- Countries where SMS authentication is supported
- Disabling two-factor authentication for your personal account
Troubleshooting SSH
- Using SSH over the HTTPS port
- Recovering your SSH key passphrase
- Deleted or missing SSH keys
- Error: Host key verification failed
- Error: Permission denied (publickey)
- Error: Bad file number
- Error: Key already in use
- Error: Permission to user/repo denied to other-user
- Error: Permission to user/repo denied to user/other-repo
- Error: Agent admitted failure to sign
- Error: ssh-add: illegal option -- apple-use-keychain
- Error: SSL certificate problem, verify that the CA cert is OK
- Error: Unknown key type
- Error: We're doing an SSH key audit