Windows 10 now has OpenSSH built right in, and it only takes one command to set it up!
Install it using Microsoft's documentation
and then either generate a new ssh key right in your Command Prompt window, or
generate a private and public key (the new Microsoft OpenSSH version,
or the older Putty private key with Puttygen). For better security,
where possible, choose ed25119
type keys instead of
RSA
.
Here's how to generate an SSH key on any version of Windows*: (Windows replaces the tilde character, ~, with your entire home directory path.)
mkdir -p ~/.ssh/
ssh-keygen -t ed25519
You can just press enter for each prompt.
This will generate your SSH private key in the file ~/.ssh/id_ed25519
and your
public key in the file ~/.ssh/id_ed25519.pub
. (Note the .pub
).
You can then upload your public key to Userify or Github by copying and pasting the contents of
~/.ssh/id_ed25519.pub
in your home directory to Userify. Just notepad the file and
copy and paste it into Userify:
notepad .ssh/id_ed25519.pub
That's it! You now know how to generate an SSH key! Your private key is stored in id_ed25519
.
Important:
your public key is the same name with the .pub on the end (id_ed25519
).
You should never copy your private key or store it anywhere else, but your public key is, you know, public;
you can put it anywhere. Just generate a new private key on any new devices
that you use and then just paste your public key into your servers' authorized_keys files
(or Userify, which manages your team's authorized_keys and sudo permissions for you).
Now that you've put your public key onto a remote server (via Userify above or similar), you can instantly log in without typing a password, just by typing in:
ssh YourUserifyUsername@ServerIP
If your Userify username is different from your
Windows username, you can either ssh username@IP
each time or just add the following to .ssh/config
,
and then just ssh IP
and drop your username from the command.
In your home directory's .ssh/ directory, create a file named config
:
Host *
User YourUserifyUsername
Compatibility: This has been tested on Windows 10 and 11, but earlier versions of Windows (or if you don't wish to install OpenSSH) can use Putty SSH or another terminal such as SecureCRT, or OpenSSH within Ming/Cygwin/etc.
Also, this produces more secure and modern (and shorter!) curve 25519
(ED25519) keys, but if you prefer the older RSA keys, or you have to talk to
an older system that doesn't support ED25519, just remove the -t ed25519
from the ssh-keygen command in the first step above.
© 2022 SSHKey.com