Permanently add multiple ssh-keys for different servers Ubuntu [permission denied public key]


In ~/.ssh/config file.


Host *
    IdentitiesOnly yes

# incase of amazon
Host host_url NameOfYourChoice
    User username
    Hostname host_url
    RSAAuthentication yes
    Compression yes
    IdentityFile ~/.ssh/private_key.pem


#incase of github
Host github.com github_coeus
    User taimoor
    Hostname github.com
    RSAAuthentication yes
    Compression yes
    IdentityFile ~/.ssh/my_private_key

#incase of heroku
Host heroku.com heroku_taimoor
    User taimoor
    Hostname heroku.com
    RSAAuthentication yes
    Compression yes
    IdentityFile ~/.ssh/my_private_key


So the pattern is same incase of any server you are connecting.

Advertisements

I am Senior Software Engineer. I love reading, writing, sharing,developing, hiking, movies, trips, mountains, brooks, hills etc.

Tagged with: , ,
Posted in git

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

StackOverFlow
Categories
Archives
%d bloggers like this: