Questions tagged [private-key]

147 questions
1179
votes
25 answers

How to tell git which private key to use?

ssh has the -i option to tell which private key file to use when authenticating: -i identity_fileSelects a file from which the identity (private key) for RSA or DSA authentication is read.  The default is ~/.ssh/identity for protocol…
jrdioko
  • 13,195
492
votes
18 answers

Windows SSH: Permissions for 'private-key' are too open

I've OpenSSH 7.6 installed in Windows 7 for testing purposes. SSH client & server work just fine till I tried to access one of my AWS EC2 box from this windows. It seems like I need to change the permission on the private key file. This can be…
Sabrina
  • 5,743
219
votes
9 answers

How do I configure SSH so it doesn't try all the identity files automatically?

I have been putting my ssh identity files inside my ~/.ssh/ folder. I have probably about 30 files in there. When I connect to servers, I will specify the identity file to use with something like ssh -i ~/.ssh/client1-identity…
cwd
  • 18,788
  • 43
  • 123
  • 162
210
votes
3 answers

How to force ssh to use a specific private key?

With ssh -i you can instruct ssh to use an extra private key to try authentication. The documentation is not clear on how to explicitly use only that key.
100
votes
4 answers

Are GPG and SSH keys interchangable?

I want to generate an RSA key in GPG and use it in SSH login. Is this even possible? If so, how? edit: see @wwerner's answer, I didn't try it but it seems to be the current solution (as of 2018)
destan
  • 1,157
90
votes
4 answers

How can I change the comment field of an RSA key (SSH)?

I know I can simply open up the pubkey and change the comment after the ==s, but is the comment field decided upon at creation stored in the private key as well? If so, how can I change that field without generating an entirely new key from scratch?
ELLIOTTCABLE
  • 2,708
37
votes
5 answers

How do you safely backup a GPG private key?

I found a very interesting CLI password manager called pass. To use it, you generate a GPG2 key pair, and use the tool to help you store passwords in gpg2 encrypted files. To encrypt the files (add a new password), it uses the public key. To decrypt…
Tal
  • 473
33
votes
1 answer

GnuPG / OpenGPG: Recovering public key from private key

I know that the public SSH key can be recovered from the private using ssh-keygen -y. How can a (deleted) public key be recovered from the private key in GPG (preferably in a way that is OpenGPG compatible)?
leden
  • 806
31
votes
2 answers

What is the difference between the .pem and .pub and non suffixed ssh credentials files?

Running "ssh-keygen -t dsa" generates two files, a private and public key. Its simple enough to comprehend that the private key is used to identify yourself to the outside world, which only sees your public key. However, I've also seen ".pem" files…
30
votes
7 answers

No supported authentication methods available in FileZilla

I'm using FileZilla to connect to my SFTP server. But when I'm trying to connect, it gives me this error Error: Disconnected: No supported authentication methods available (server sent: publickey) I have generated a private key with PuTTYgen…
30
votes
3 answers

Can't import public key into OSX Keychain

I created a couple of self-signed S/MIME certificates (using OSX Keychain & OpenSSL) and then exported these into 3 files: Certificate (.cer) Private Key (.p12) Public Key (.pem) When attempting to import these back into another Mac, the…
Prembo
  • 401
27
votes
2 answers

How to revoke a GPG Key and upload in GPG server?

I have create GPG Keys for code signing and created a revocation certificate also. As far as I know, if key is compromised then i can revoke the key using revocation certificate. Can someone suggest me how to revoke my key with revocation…
23
votes
2 answers

How do I get WinSCP to connect to an SSH server with a private key that I specify?

How do I get WinSCP to connect to an SSH server with a private key that I specify. I don't see the option. For example, I have a private key I created with SSH in cygwin (id_rsa). $ ls ~/.ssh -l -rw------- 1 user None 2602 Dec 24 17:26…
barlop
  • 25,198
21
votes
1 answer

How to quickly identify SSH private key file formats?

Triggered today by Remote Desktop Manager, whose SSH Key Generator offered to save a private key in OpenSSH format, but then proceeded to store it in PKCS#1 / OpenSSL format, while using the same random *.pri file extension for two of the offered…
14
votes
1 answer

Security concerns of displaying ssh private key

I've made a huge mistake, or at least I think I did: I've "catted" my private SSH key cat ~/.ssh/id_rsa I'm now afraid that I've created a security hole, allowing other users to see my private key by looking at bash/scrollback history or using…
LeartS
  • 243
1
2 3
9 10