Skip to content

Instantly share code, notes, and snippets.

@yebt
Last active September 19, 2022 21:01
Show Gist options
  • Save yebt/fdc3934d97aa9cc6ab681ea554a4d977 to your computer and use it in GitHub Desktop.
Save yebt/fdc3934d97aa9cc6ab681ea554a4d977 to your computer and use it in GitHub Desktop.
This is a file to how confugate ssh access

Gen

ssh-keygen -t rsa -b 4096 -C "yourmail@gmail.com"

Test connection

ssh -T git@github.com
ssh -T git@gitlab.com

Config

.ssh/config

# vim: tabstop=2 shiftwidth=2 softtabstop=2
# GitLab.com
Host gitlab.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/gitlab_rsa

# GitHub.com
Host github.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/github_rsa

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