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.
- 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/
- Create the config file by running:
- touch config
- If they file already exists, proceed to the next step.
Open the new config file, below is an example using nano, but any editor would work:
- nano config
- Once open, use the arrow keys to ensure the cursor is at the very bottom of the file
- 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
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.