Showing posts with label ssh key. Show all posts
Showing posts with label ssh key. Show all posts

Tuesday, January 12, 2016

Configuring ssh keys for git access on Ubuntu

To be able to connect to a git repository with ssh access (ssh://) use the following steps:
  • copy your private key file to ~/.ssh
  • create (if it doesn't exist) the file ~/.ssh/config and add the following content:
Host my_githost.com
    HostName my_githost.com
    User my_username
    IdentityFile ~/.ssh/my_private_key_file
  • change the permissions to the private key file:
chmod 400 ~/.ssh/my_private_key_file
Now you can clone your repository.