SSH: Difference between revisions

From My Wiki
Jump to navigation Jump to search
Using Puttygen: Added bit about putty-tools
m Using Puttygen: Tagged putty-tools
Line 10: Line 10:
==Using Puttygen==
==Using Puttygen==
===Linux===
===Linux===
Install the putty-tools package if you haven't already.  
<p>Install the putty-tools package if you haven't already. </p>
Create the key:
Create the key:
  puttygen -t ed25519 -C "Your comment here" -o ~/.ssh/$hostname.ppk
  puttygen -t ed25519 -C "Your comment here" -o ~/.ssh/$hostname.ppk

Revision as of 21:32, April 4, 2022

SSH Keys

Using OpenSSH

Create a key:

ssh-keygen -t ed25519 -C "Your comment here" -f ~/.ssh/$hostname.key

Or, in RSA format:

ssh-keygen -t rsa -b 4096 -C "Your comment here" -f ~/.ssh/$hostname2.key

Make sure it has safe permissions:

chown 600 $hostname*.key

Then for the user you want to log in as, copy the .pub file's contents to the user's .ssh/authorized_keys file. It also needs to have 600 permissions.

Using Puttygen

Linux

Install the putty-tools package if you haven't already.

Create the key:

puttygen -t ed25519 -C "Your comment here" -o ~/.ssh/$hostname.ppk

Or, in the RSA format:

puttygen -t rsa -b 4096 -C "Your comment here" -o ~/.ssh/$hostname2.ppk

Either way, the file should have 600 permissions. Print the public key:

puttygen -L ~/.ssh/$hostname.ppk

Then for the user you want to log in as, copy the output to the user's .ssh/authorized_keys file. It also needs to have 600 permissions.