Post

Creating an SSH config file

The SSH configuration file tells the computer which key file to use when connecting to a specific server hostname. SSH Gateway and GitPush use different hostnames on WP Engine.

Setting up a SSH config file, and telling the computer in advance which SSH key is used for a service, will prevent any possible connection issues.

  1. On the local machine, first navigate to the .ssh directory.
  • MacOS – Open Terminal and type:
    • cd ~/.ssh/
  • Windows – Use Git Bash and navigate to:
    • /c/Users/[youruser]/.ssh/
  1. Create the config file by running:
    • touch config
    • If they file already exists, proceed to the next step.
  2. Open the new config file, below is an example using nano, but any editor would work:

    • nano config
  3. Once open, use the arrow keys to ensure the cursor is at the very bottom of the file
  4. Paste the following contents:
1
2
3
4
5
6
   Host git.wpengine.com
   User git
   Hostname git.wpengine.com
   PreferredAuthentications publickey
   IdentityFile ~/.ssh/wpegitkey
 IdentitiesOnly yes
  1. Then save and exit. For nano:

    • Hold ctrl button then press x

test the ssh config entry

1
ssh git@git.wpengine.com info

on wpengine this will return a response like

1
2
3
hello user-localtesting
R W    localtesting
Please see http://git.wpengine.com for more help
This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.