126 votes
Accepted

How to make git not prompt for passphrase for ssh key?

You can run this in git bash, Windows WLS or bash on real GNU/Linux. eval `ssh-agent -s` ssh-add ~/.ssh/*_rsa it will ask for pass phrase in the second command, and that's it. Each additional action ...
jcubic's user avatar
  • 2,933
118 votes

Bad owner or permissions on ssh config file

You need to change the permissions of .ssh directory. Run the following, (I found 600 will not fix it on its own): chmod 700 ~/.ssh chmod 600 ~/.ssh/*
Aindriú's user avatar
  • 1,286
75 votes

SSH-Key authentication fails

This will usually resolve most SSH authorized key permission issues on the server side, assuming someone didn't make additional changes to the permissions. # paste these into an SSH session that ...
fatal_error's user avatar
72 votes
Accepted

Read Only access to GitHub repo via SSH key

Deploy Keys to the rescue A deploy key is an SSH key that : is stored on your server and grants access to a single GitHub repository. Often used to clone repositories during deploys or continuous ...
C0deDaedalus's user avatar
  • 2,560
53 votes
Accepted

Configure ssh-key path to use for a specific host

One option you could consider would be to user the .ssh/config file. Example: .ssh/config Host server.com HostName server.com User serveruser IdentityFile /Users/myuser/.ssh/mykey By ...
Erik's user avatar
  • 1,486
43 votes

Missing ~/.ssh Folder in macOS High Sierra

In macOS, you need to generate your public and private keys from the Terminal. If you haven't yet done this, the .ssh directory will not exist. To create them: Open the terminal App and enter the ...
baelx's user avatar
  • 2,986
33 votes

How to make git not prompt for passphrase for ssh key?

A slightly better and permanent solution is to auto launch the ssh-agent when opening the git bash on windows. You can copy/paste the below in your .profile or .bashrc. I prefer to put it on the ....
velval's user avatar
  • 453
33 votes

Get the fingerprint of an existing SSH public key

In recent versions of ssh-keygen, one gets an RSA public key fingerprint on Unix-based systems with something like: $ ssh-keygen -l -E md5 -f ~/.ssh/id_rsa.pub where the path refers to a public key ...
Cris P's user avatar
  • 431
30 votes
Accepted

How to secure SSH Private key on Windows 10

Keys must only be accessible to the user they're intended for and no other account, service, or group. GUI: [File] Properties → Security → Advanced Owner: Change → Select a principal → Enter key's ...
JW0914's user avatar
  • 7,704
27 votes

To use ssh-id-copy do you need both id_rsa.pub and id_rsa?

It's not necessary to have the private key file to authorize a key on a server. In fact, you should never ask a friend for their private key, it's called private because it should be kept to yourself. ...
Dario Seidl's user avatar
  • 3,915
26 votes

SSH-Key authentication fails

I had the exact same problem on two servers: a Linux running Debian stretch and on a NAS (Synology DS715) it turned out that in both cases, the home directory permissions on the server were wrong ...
Cyril Chaboisseau's user avatar
25 votes

Bad owner or permissions on ssh config file

The general rule for the files that can affect the security (private keys, configuration files, authorized keys) is that they should not be writable by anyone else than the owner (the private keys ...
Jakuje's user avatar
  • 10.2k
24 votes

SSH-Key authentication fails

When using CentOS 7, and I'm confident applies to other Linux OS's using sshd as well. With root access, you can determine more about why authentication may be failing. To do this: Enable logging for ...
JonCav's user avatar
  • 341
24 votes

How to ssh-copy-id 2nd key when the server only allows publickey authentication

ssh-copy-id appends keys to the remote authorized_keys file. To add several specific keys, run it once per key with -I <key-file-name>. Update After your comment, I think I got your question ...
sborsky's user avatar
  • 959
23 votes
Accepted

SSH Key Authentication on Synology NAS

Although none of the other answers directly fixed it, I took some of their methods and combined them. This is what worked for me on my Synology DS414slim, running DSM 6.1. I logged in as admin and ...
George's user avatar
  • 462
23 votes

How to quickly identify SSH private key file formats?

The file extension is often either random or not enough to identify the format. Broad categories: PEM files with ASN.1 data, encoded with DER PEM files with data encoded in some other format Non-PEM ...
Reto Höhener's user avatar
22 votes

Read Only access to GitHub repo via SSH key

Github organizations can "sort of" support this work-flow: Create an organization Create a dummy account which will be used for readonly access Add the dummy account to the organization with read-...
Slava Knyazev's user avatar
21 votes

Running ssh-keygen without human interaction?

In case of server deployment: ssh-keygen -t rsa -q -f "$HOME/.ssh/id_rsa" -N "" In terms of communication from server installed to git repositories or other servers would be easy.
Yogesh Kamat's user avatar
19 votes

Get the fingerprint of an existing SSH public key

Install openssh and openssl packages which contain the commands. # get the SHA256 and ascii art ssh-keygen -l -v -f /path/to/publickey # get the MD5 for private key openssl pkey -in /path/to/...
strobelight's user avatar
18 votes

How to fix warning about ECDSA host key

I added the following lines to my ~/.ssh/config, thus disabling strict host checking for all .local addresses. (with DHCP address allocation, ip addresses of my local machines are always changing) ...
KimSJ's user avatar
  • 281
18 votes
Accepted

How to verify host fingerprint in Openssh

Your SSH server is providing SHA256 public key hashes, which is far more secure than MD5 hashes. You then have to specify to ssh-keygen that you want SHA256 instead of MD5 hashes. Try executing the ...
vera's user avatar
  • 1,270
18 votes
Accepted

What does ssh-keygen [-o] do?

Quoting OpenSSH 7.7 man page of ssh-keygen: -o Causes ssh-keygen to save private keys using the new OpenSSH format rather than the more compatible PEM format. The new format has increased ...
Martin Prikryl's user avatar
18 votes

How do I connect to SFTP with provided SSH Key?

if you use an sftp to connect to an sftp server, you should generate an ssh keypair (ie on unix: ssh-keygen) and provide your the public key (ie .ssh/id_rsa.pub or .ssh/id_ed25519.pub) to the sftp-...
nikiwaibel's user avatar
14 votes
Accepted

Passwordless login via SSH from multiple computers

You either follow that procedure for multiple machines or copy the private key. Depending on your personal security requirements and workflow one might be easier or "better" than the other. If your ...
Seth's user avatar
  • 9,145
14 votes

How do I use KeePassXC as an SSH agent?

The SSH Agent has a whole dedicated section in KeePassXC docs. It's probably best to read it whole to get a general idea of how it works. If you don't want to, here's a summary. KeePassXC doesn't act ...
gronostaj's user avatar
  • 56.8k
13 votes

How to store SSH keys?

There is a very nice tool named KeePass2 (http://keepass.info/) with the extension (http://lechnology.com/software/keeagent/) You can store there Passwords, SSH Keys, and a lot more(on the official ...
CentrixDE's user avatar
  • 742
13 votes

How to convert .ppk key to OpenSSH key under Linux?

Get the private key: open the .ppk file in puttygen: puttygen ~/.ssh/id_dsa.ppk export as openssh: Conversions → Export OpenSSH key Get the public key: open like before the private key with ...
Bar Horing's user avatar
12 votes

How to verify host fingerprint in Openssh

Commands used Display ascii-art of the public host key stored on the server (to be done on server side, the one you connect TO via ssh): ssh-keygen -l -v -E md5 -f /etc/ssh/ssh_host_ecdsa_key.pub -...
Nicolas VERHELST's user avatar
12 votes

How to compute GitLab deploy key fingerprint from ssh key-pair

SSH key fingerprints are simply hashes of entire public-key block (the large AAAA...= blob in your id_rsa.pub). First Base64-decode that field, then compute its MD5 or SHA256 hash, finally print it in ...
u1686_grawity's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible