Tag Archives: SSH

SSH Linux login without password

Below is probably the quickest way to achieve this

 

1. Generate SSH key (if you don’t have one already)

ssh-keygen -t rsa

 

2. Use SSH to create a remote directory ~/.ssh

ssh username@dev.company.com mkdir -p .ssh

 

3. Append your public key to .ssh/authorized_keys on remote host

cat ~/.ssh/id_rsa.pub | ssh username@dev.company.com 'cat >> .ssh/authorized_keys'

 

 

That’s it!

Advertisements

SSH Key Authentication with GitLab

Every time i start building a product for a new company, one of the first step is creating a repository and uploading SSH key. Instead of browsing the web looking for a reminder on how to do it, i decided i’ll post the quickest solution here.

 

1. Enter the following command in the Terminal window (Mac OS X)

ssh-keygen -t rsa

 

2. Accept default location and leave password blank (or not, up to you)

 

3. The key will get generated

Your identification has been saved in /Users/mariuszprzydatek/.ssh/id_rsa.
Your public key has been saved in /Users/mariuszprzydatek/.ssh/id_rsa.pub.
The key fingerprint is:
ce:80:76:66:5b:5d:d2:29:3d:64:66:65:e8:d3:aa:5e mariuszprzydatek@Mariuszs-MacBook-Pro.local
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|         .       |
|        E .      |
|   .   . o       |
|  o . . S .      |
| + + o . +       |
|. + o = o +      |
| o...o * o       |
|.  oo.o .        |
+-----------------+

 

4. The private key (id_rsa) is saved in the .ssh directory and used to verify the public key. The public key (id_rsa.pub) is the key you’ll be uploading to your GitLab account.

 

5. Copy your public key to the clipboard

pbcopy < ~/.ssh/id_rsa.pub

 

6. Paste the key to GitLab

 

GitLab SSH Key Authentication

 

 

Cheers!