This HowTo teaches you how to Generating a new SSH key and adding it to the ssh-agent.

Write Access is *ONLY* with "SSH Key-Based Authentication" Allowed
Using the SSH protocol, you can connect and authenticate to remote servers and services. With SSH keys, you can connect to git Service without supplying your username or password at each visit.

1. Generating a new SSH key

  • Open Terminal.

ssh-keygen -t rsa -b 4096 -C ""
  • This creates a new ssh key, using the provided email as a label.

When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
    > Enter a file in which to save the key (/home/you/.ssh/id_rsa): [Press enter]

    At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases".

    > Enter passphrase (empty for no passphrase): [Type a passphrase]
    > Enter same passphrase again: [Type passphrase again]

2. Adding your SSH key to the ssh-agent

vim /home/user/.ssh/config

    Preferredauthentications publickey
    IdentityFile /home/user/.ssh/file_ssh_key (1)
    User git
    Port 2222
1 key path

3. Adding a new SSH key to your account

  • Copy the SSH key to your clipboard.

  • In the upper-right corner of "Git Service", click Settings.

gitea ssh key 1
  • In the user settings menou, click "SSH/GPG keys".

gitea ssh key
  • Paste your key into the "Content" field.