Skip to content

Instantly share code, notes, and snippets.

@EricPSU
Last active April 18, 2018 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EricPSU/ce032b5309337a6cc7cbe31f10f722eb to your computer and use it in GitHub Desktop.
Save EricPSU/ce032b5309337a6cc7cbe31f10f722eb to your computer and use it in GitHub Desktop.
GitLab Key Pair
# Create a public/private rsa key pair
ssh-keygen -t rsa -C "eric@omegaminds.com" -b 4096
# Associate the key pair to the server you are attempting to authenicate
ssh-copy-id -i ~/.ssh/id_rsa.pub eaflanigan@watson-dev
# Run ssh-add on the client machine, that will add the SSH key to the agent
ssh-add
# List SSH keys to verify
ssh-add -l
# Test by logging into server without password
ssh eaflanigan@watson-dev
# Copy the public SSH key
cat ~/.ssh/id_rsa.pub
# Navigate to the 'SSH Keys' tab in your 'Profile Settings'.
# Paste your key in the 'Key' section and give it a relevant 'Title'.
# Use an identifiable title like 'Work Laptop - Windows 7' or
# 'Home MacBook Pro 15'.
###########################################################
[eaflanigan@crmi-devwkstn06 .ssh]$ ssh-keygen -t rsa -C "eric@omegaminds.com" -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/home/eaflanigan/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/eaflanigan/.ssh/id_rsa.
Your public key has been saved in /home/eaflanigan/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:DjRYUAuaB6pLflmwBzoeiAypwua+4JHVsD0v2Y+Tr7s eric@omegaminds.com
The key's randomart image is:
+---[RSA 4096]----+
| . ooo |
| o + + . |
|+ o+o + |
|O ..O. . |
|*O + *. S |
|B.= + =o |
|o* o o oo |
|+ o .oo |
| +. E*o |
+----[SHA256]-----+
[eaflanigan@crmi-devwkstn06 .ssh]$ ssh-copy-id -i ~/.ssh/id_rsa.pub eaflanigan@watson-dev
/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/eaflanigan/.ssh/id_rsa.pub"
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
eaflanigan@watson-dev's password:
[eaflanigan@crmi-devwkstn06 .ssh]$ ssh-add
Enter passphrase for /home/eaflanigan/.ssh/id_rsa:
Identity added: /home/eaflanigan/.ssh/id_rsa (/home/eaflanigan/.ssh/id_rsa)
[eaflanigan@crmi-devwkstn06 .ssh]$ ssh-add -l
4096 SHA256:DjRYUAuaB6pLflmwBzoeiAypwua+4JHVsD0v2Y+Tr7s /home/eaflanigan/.ssh/id_rsa (RSA)
4096 SHA256:DjRYUAuaB6pLflmwBzoeiAypwua+4JHVsD0v2Y+Tr7s eric@omegaminds.com (RSA)
[eaflanigan@crmi-devwkstn06 .ssh]$ ssh eaflanigan@watson-dev
Last login: Wed Apr 18 13:49:32 2018 from crmi-devwkstn06.praxislan02.com
[eaflanigan@watson-dev ~]$ exit
logout
Connection to watson-dev closed.
[eaflanigan@crmi-devwkstn06 .ssh]$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCo5Q8v+rx5ZkqT8oJ+7L6z7r8wzN+eXj08NhGdsDmJ/fjjgGOVXmCaZLFiDIjxQn9i0wQUJA04ZgyzICKyiYpoMswGkcbXt46mUN//0pyu0Vg1LqO94OAR0syVnoip77UkkBO6n5WSzt2PUiRlsT+MBJvGIlFURwzekH8QM7t29ogJHSA76BpeWQkrWCNU+zkRl6zl/602KvQa+qAt2+u5u4Ypfon579kYlIOrnGiuloytX5hdwh9o0qLeQwnb9N5DdhxeKtqRLCMdag8BuC9ZYImePXa1CWHZbh+2Iejhqxiew4cyfP7VASkflcoUeRT8VWIS8i65aJ4XMLmCA5s+SMD6xQ8v8g875pZ14vVcXInxKrNSaJ4pnOSA8LJxLVh4l77fDUnhdulOTkvh9kZVvtw/CVjJkYLEkjoRuNpli8iWbjYoG822CDJQxb0ZiTqUZO8KhdwVUAz/eVrt/V3wWtvPqP46FuFfwswvREklxRTLSNcO/CMVJof8gZsirWYc1Afk92mLiklgm9lh5WSIewlUj+C1ejrZ21QliOj9LWqhSxGiCUBOQ2XVgUG7PnChIT3uWfHQjoHjNn7HUAPeSFuN12W0C+VUznSdSRe5qUzqVRJlHbDqPaSNywYuWVzHjmWUznt+gkMBneVMU0MOh3tw7q2d5Pvb98mfuhNLLw== eric@omegaminds.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment