SSH force usage of a specific key | Drupal 8

SSH force usage of a specific key

Submitted by editor on Tue, 01/02/2018 - 10:46
Question

How to force usage of a specific key for SSH ?

To force usage of a specific key, put in your ~/.ssh/config file :

Host [HOST_NAME]
   Hostname [HOST_NAME]
   User [USER_NAME]
   Port [PORT]
   IdentityFile ~/.ssh/[your_private_key]

 

Example for gitlab:
Host gitlab.company.com
   Hostname gitlab.company.com
   User git
   Port 10022
   IdentityFile ~/.ssh/[your_private_key]

Tags

Add new comment