Linux Essentials - Public Key Authentication

Originally published at: Linux Essentials – Public Key Authentication – LearnLinuxTV

Public Key Authentication with OpenSSH is preferred, as it’s a much stronger method of authenticating to your servers when compared to using password authentication. In fact, password authentication in OpenSSH should always be disabled. But before you can password authentication, you’ll need to set up public key authentication, and that’s exactly what we’ll do in today’s video.

2 Likes

just an fyi, window power shell does have ssh now, as of power shell version 7
windows docs
powershell

1 Like

connecting is the same, I use this because I don’t want to install the windows subsystem for linux or putty.

Nice; does it give you the ssh agent, too?

I usually do not use it, but it does have it, but you need to enable it and add the path

# By default the ssh-agent service is disabled. Allow it to be manually started for the next step to work.
# Make sure you're running as an Administrator.
Get-Service ssh-agent | Set-Service -StartupType Manual

# Start the service
Start-Service ssh-agent

# This should return a status of Running
Get-Service ssh-agent

# Now load your key files into ssh-agent
ssh-add ~\.ssh\id_ed25519

That is what the docs say, everything works except when I add the key, it stores it in

C:\Windows\System32

at least thats where mine is by default

1 Like

OIC, thanks. I think having the agent is lots nicer when using ssh for a lot of things, like for ansible, git, etc.