Epics@GSI Webhome

SSH config: host specific identity

Introduction

Using the features of the config file of ssh in ~/.ssh one can specify host specific ssh options, including varying identities and users.

from: http://www.gelato.unsw.edu.au/archives/git/0611/31044.html

Example:
  • connecting to a specific host using a different identity file and user
    $> cat ~/.ssh/config
       Host private.host.com
          User myname
          Hostname host.com
          IdentityFile ~/.ssh/private-identity
       Host public.host.com
          User anotherName
          Hostname host.com
          IdentityFile ~/.ssh/public-identity
       Host git.host.com
          User git
          Hostname host.com
          IdentityFile ~/.ssh/git-identity
         
  • allows to replace:
    • ssh host.com -l myname -i ~/.ssh/private-identity
      by
      ssh host.com
    • commands which internally use ssh but do not allow to pass ssh options, e.g. git
      git clone git.host.com


-- PeterZumbruch - 10 May 2013

This topic: Epics > WebHome > DevelopersCorner > TippsSshConfigHostSpecificIdentity
Topic revision: 2013-05-10, PeterZumbruch
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)