Skip to content

Instantly share code, notes, and snippets.

@mike-moreau
Created July 9, 2025 18:51
Show Gist options
  • Select an option

  • Save mike-moreau/3bcfe342542b92153f0b8c0c41faf1a1 to your computer and use it in GitHub Desktop.

Select an option

Save mike-moreau/3bcfe342542b92153f0b8c0c41faf1a1 to your computer and use it in GitHub Desktop.
mac ssh config file examples
# ~/.shh/config
# Defaults for all hosts
Host *
UseKeychain yes
AddKeysToAgent yes
Host github.com
IdentityFile ~/.ssh/id_github
Host bitbucket.org
IdentityFile ~/.ssh/id_ms_bitbucket
# Wildcard Domain
Host *.example.com
IdentityFile ~/.ssh/id_example
# IP Address
Host 12.34.567.8
User userNameHere
IdentityFile ~/.ssh/id_host_name_here
# Custom Host Name
Host example
HostName ftp.example.com
User exampleUserName
Port 2222
IdentityFile ~/.ssh/id_example
@mike-moreau

Copy link
Copy Markdown
Author

assumes using different keys for each host

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment