post image :date_long | 1 min Read

SSH config examples


vim ~/.ssh/config
...

Host git-codecommit.*.amazonaws.com
  User A...SVRJMWFPY
  IdentityFile ~/.ssh/kops-aws

Host  1.2.3.4
  HostName  1.2.3.4
  ForwardAgent yes
  User ec2-user
  AddKeysToAgent yes
  IdentityFile ~/Downloads/cert-developer.pem


# Example with JUMP server
Host e2-bastion  11.22.33.44
  HostName 11.22.33.44
  ForwardAgent yes
  User ec2-user
  AddKeysToAgent yes
  IdentitiesOnly yes
  IdentityFile ~/.ssh/bastion.id_rsa

Host final-server 44.55.66.77
  HostName 44.55.66.77
  ForwardAgent yes
  User ec2-user
  Port 22
  AddKeysToAgent yes
  IdentitiesOnly yes
  IdentityFile ~/.ssh/bastion.id_rsa
  ProxyCommand ssh -q -W %h:%p e2-bastion


# linuxinuse account
Host gitlab.websupport.sk
        HostName gitlab.websupport.sk
        User git
        IdentitiesOnly yes
        IdentityFile ~/.ssh/websupport-ssh
...
:wq!

author image

Jan Toth

I have been in DevOps related jobs for past 6 years dealing mainly with Kubernetes in AWS and on-premise as well. I spent quite a lot …

comments powered by Disqus