Questions tagged [ssh-keygen]
193 questions
253
votes
9 answers
How can I remove an SSH key?
I currently have an old SSH key uploaded on a server. The problem is I lost my ~/.ssh directory (with the original id_rsa and id_rsa.pub files).
Consequently, I want to remove the old SSH key directly on the server and upload a new one.
I tried the…

user1364743
- 5,283
- 6
- 51
- 90
160
votes
12 answers
Generate new ssh keys in Windows 10 / 11
I am having a really hard time getting my SSH keys up and running after installing Windows 10. Normal method is create it and throw it in the user's account under .ssh. But this folder does not appear to be available in Windows 10.
I need to have 3…

Rudenate3
- 1,821
- 2
- 12
- 13
30
votes
5 answers
Adding an RSA key without overwriting
I want to generate a set of keys for a home server that I would like to SSH into, so I do ssh-keygen -t rsa, but then I get a message: id_rsa already exists. Overwrite (y/n)?
Well, I don't want to overwrite because the keys I have now I use to SSH…

itsmichaelwang
- 2,282
- 4
- 16
- 25
19
votes
2 answers
Cannot parse privateKey: Unsupported key format
In my Mac book pro with OS Majave, I used SSH-KEYGEN generate a new SSH key for node.js module SSH2. However, I got error message: Cannot parse privateKey: Unsupported key format
I validated the key with ssh command, it just works fine. But not with…

George Zhang
- 371
- 1
- 2
- 9
17
votes
2 answers
Why use `-t rsa -b 4096` with ssh-keygen?
Why should I use the options, -t rsa, -b 4096, and -C "myemail@example.com" when creating an SSH key, as instructed by github? If I create an SSH key without these options, is it less secure? If so, why?
What frustrates me about these options is…

rm.rf.etc
- 884
- 2
- 8
- 20
14
votes
2 answers
Password protect a pem file
I'd like to SSH into my EC2 instance with a password protected pem file. How do I password protect a pem file? I've done this in the past but can't remember how I did it. I took a pem file generated by AWS and ran some command on it and it…

LampShade
- 2,675
- 5
- 30
- 60
12
votes
2 answers
Connection reset by {ssh hostname} port 22
I'm trying to set up a raspberry pi with the command ssh pi@raspberrypi.local but I keep getting these messages:
ssh -v pi@raspberrypi.local
OpenSSH_7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /etc/ssh/ssh_config
debug1:…

liz
- 163
- 1
- 1
- 7
11
votes
2 answers
Should I use my personal email in my ssh public keys?
Reading Github's Generating SSH keys tutorial, I saw this on the Step 2: Generate a new SSH key:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
What bothers me is the "your_email@example.com". I know that is just a comment and it is even…

Diego Mora Cespedes
- 3,605
- 5
- 26
- 33
8
votes
2 answers
Validate contents of .ssh/known_hosts file
Is there some cli tool I can use to validate the contents of known_hosts? Maybe try to ping all the hosts in there and see if I can connect to each?
Probably using either ssh-keygen or ssh-keyscan?

Alexander Mills
- 90,741
- 139
- 482
- 817
8
votes
3 answers
What exactly does `ssh-keygen -A` do?
$ ssh-keygen --help
ssh-keygen: unrecognized option: -
usage: ssh-keygen [-q] [-b bits] [-t dsa | ecdsa | ed25519 | rsa]
[-N new_passphrase] [-C comment] [-f output_keyfile]
ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f…

Zak
- 12,213
- 21
- 59
- 105
7
votes
1 answer
SSH key generated by ssh-keygen is not recognized by Paramiko: "not a valid RSA private key file"
I have the following code:
ssh_key = paramiko.RSAKey.from_private_key_file(key_filename)
the key looks like this:
-----BEGIN OPENSSH PRIVATE…

Thomas
- 10,933
- 14
- 65
- 136
6
votes
2 answers
Changing ssh passphrase with ssh-keygen makes a change of the ssh key?
I set the passphrase of my ssh key by mistake.
But it is annoying that putting the passphrase for every time using the key.
I'd like to remove the passphrase of my key with:
$ ssh-keygen -p -f
I'm afraid of that, however, the key…

홍한석
- 439
- 7
- 21
6
votes
3 answers
ssh eval "$(ssh-agent -s) returns Illegal variable name
Why does the eval statement return
Illegal variable name
$ eval "$(ssh-agent -s)"
Illegal variable name.

gkmohit
- 690
- 2
- 12
- 28
5
votes
1 answer
SSH authentication in Artifactory
I tried reading Artifactory user guide but the instructions on SSH authentication were not clear. Can someone explain how to do SSH authentication in Artifactory?

Drithin
- 51
- 1
- 4
5
votes
0 answers
Creating RFC-4716 specific dsa public-key using openssl
For the purpose of ssh using public key authentication,
DSA-2048 keypair has been generated using openssl and both are stored locally in PEM format.
Now, for configuring in the server side (authorized_keys), public key has to be in the RFC-4716…

Raja
- 51
- 3