Questions tagged [ssh-keygen]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
57 views

Even if SSH is set up, it always asks for the password when logging into the server

I have an Ubuntu server. I use ssh to access it. It worked fine at first. When user@IP is given along with SSH key, it will log into the server without asking for password. But recently, even with SSH,...
Sachintha madhawa's user avatar
0 votes
2 answers
135 views

Why ssh-keygen & ssh-copy-id create files with incorrect permissions

I have a FreeBSD host (sh) that I just set up last week, and it is doing these two weird things that seem to be related: ssh-keygen ON this host is creating both private and pub keys with 775 file ...
jg3's user avatar
  • 179
-1 votes
1 answer
371 views

Create a pair of keys suitable for DKIM setup using ssh-keygen

Question What is the right way to create a pair of keys suitable for DKIM setup using ssh-keygen? Given the corresponding solution with openssl: # creates a private key openssl genrsa -out sample.key ...
Dmitry's user avatar
  • 117
1 vote
2 answers
711 views

How to remove all lines with the same public key from known_hosts?

Let's imagine the following scenario. I have an host key ABCDEF1234 for a given hostname, so my known_hosts file looks like this (unhashed version): example.com ssh-rsa ABCDEF1234 Now I connect to it,...
shodanex's user avatar
  • 242
0 votes
2 answers
444 views

How does SSH host verification for github.com provide any value?

Running git clone [email protected]/repo.git warns me of a potential man-in-the-middle attack when GitHub change their SSH key, and that's cool. I then get the new key by running ssh-keyscan -t rsa ...
zoran119's user avatar
  • 101
0 votes
1 answer
3k views

What is the host key (the one from ssh connection) and how is it different from public-private key pair?

The situation is that I've had a VPS created previously. It was all set up, private-public key authentication, root login turned off, password login turned off. Everything was set up. Then this server ...
michal roesler's user avatar
1 vote
1 answer
342 views

Is it safe to ssh-keygen a "ecdsa-sk" or "ed25519-sk" in a potentially compromised environment?

I'm wondering whether it would be a good practice to make sure the keys are generated in a safe environment, like a live Linux distribution, instead of just generating them in a day-to-day environment ...
luislhl's user avatar
  • 111
0 votes
1 answer
42 views

SSH key for 2 client users to 1 server user

If this is a duplicate, I'm sorry. I have searched my case but I couldn't find the right scenario that resembles my situation, although I thought that this situation must have come up before for ...
antimatter's user avatar
1 vote
1 answer
535 views

Validate all public keys in authorized_file

In my authorized_file i have multiple public keys against one private key. Now i want to add a task in ansible which will validate that all public keys are valid keys and good for connection. My aim ...
Sakshi Arora's user avatar
0 votes
0 answers
1k views

Create a public SSH key from the private key? Is an `ssh-ed25519` public key unrecoverable?

I want to recover my ssh public key from my private key. I am aware of this answer but it doesn't seem to work for me. When I run the command suggested ssh-keygen -f ~/.ssh/my_key -y > ~/.ssh/...
medic17's user avatar
  • 101
0 votes
2 answers
2k views

ssh-keygen unable to verify key "unknown option -- Y"

Context: I am trying to verify my public key on a Gitea instance. Gitea provides a token for me to generate a signature; The instructions say: echo -n 'TOKEN_PROVIDED' | ssh-keygen -Y sign -n gitea -f ...
Christian Galo's user avatar
0 votes
0 answers
171 views

Is there a way to repair SSH On GCP VM after shielded VM failure

I have a GCP VM on which is installed a Docker with Drupal. e2-medium with SSD 10Go After increasing the disk size to 20GB, I can no longer access the VM in SSH. My VM was failing to boot because of a ...
Kiswend's user avatar
1 vote
1 answer
612 views

I used ssh-keyscan in production environment. is it possible to revert back?

I used ssh-keyscan in production environment, after got to know it may allows MITM. I check in known_hosts files, fingerprint is not there. where can i check or is there any option?
Ajith's user avatar
  • 11
0 votes
1 answer
2k views

SSH Key Fingerprint Changes

So I copied an SSH private key from my Linux machine to my M1 Mac. (I've attempted to do this both by uploading the cyphertext to a secrets manager as well as directly transfering the file) but when ...
CRThaze's user avatar
  • 151
0 votes
1 answer
595 views

If I setup a 'Passwordless SSH connection' as root user, will it be applied to all other users on the server?

I'm new to the concept of SSH & password-less authentication. I'm trying to setup password-less SSH connection between two servers A & B, using SSH-keygen. If I generate the keys on "...
Kurk's user avatar
  • 1
1 vote
2 answers
24k views

No such file or directory when trying to create .ssh keys

When I attempt to create ssh keys on my Debian instance : ssh-keygen -f /home/serverkeys/.ssh/id_rsa I am getting the error : Saving key "/home/serverkeys/.ssh/id_rsa" failed: No such file ...
Golide's user avatar
  • 143
1 vote
0 answers
1k views

ssh-copy-id does not update authorized_keys file

I can't configure ssh key on my Synology NAS. File ~/.ssh/authorized_keys is not created or not updated. On remote machine (NAS): $ cd $ chmod 700 . $ chmod 700 .ssh $ touch .ssh/authorized_keys $ ...
jootl's user avatar
  • 183
0 votes
1 answer
192 views

DigitalOcean Droplet ssh to use a named key

It's been a while since I've done this and configured ssh keys. I generated an ssh key with a different file name than id_rsa I have a DigitalOcean Droplet where I placed a named ssh key pair on ...
Kyle Calica-St's user avatar
0 votes
3 answers
2k views

SSH asks for password even after i copied the public key to the remote machines

Hopefully, someone can help me resolve this nightmare. I did a project on vagrant provisioning 4 ubuntu machines, 1 controller and 3 servers. Created SSH key on controller and ssh-copy-id command to 3 ...
Kirra Lissa's user avatar
0 votes
0 answers
1k views

Disabling certain OpenSSH keys on OpenBSD: why the corresponding 'sshd_config' entries are ignored and why 'ssh-keygen -A' generates forbidden keys?

I am trying to achieve the followings on my OpenBSD 6.9 servers: Forbidding the use of all keys but the ssh-ed25519 one on both SERVER and CLIENT sides. Limiting ssh-keygen -A to generate keys only ...
Tony's user avatar
  • 11
0 votes
1 answer
157 views

duplicity SSH-RSA key fingerprint of format 102:

When I try to run duplicity between two Ubuntu servers, a message is displayed: "The authenticity of host ...... can't be established. SSH-RSA key fingerprint is 102:...:...:...:...:......." ...
user41951566's user avatar
0 votes
1 answer
889 views

Can not connect to a Google Cloud TPU using ssh (putty) in Windows

I have a google v3-8 TPU, i can't figure out how to connect to it using ssh in windows. I did every guide there is, but the connection just times out. What i tried (among others): 1. Dos command line: ...
S.Tacked's user avatar
0 votes
2 answers
2k views

how to generate a small RSA key

I want to ssh-keygen -t rsa -b 512 but my linux is too "up to date" to allow this. Is there anyway to modify the settings to: generate a 512bit key let me authenticate to the server with ...
TheHidden's user avatar
  • 111
0 votes
0 answers
132 views

SSH connection strange behavior

I am using windows10 and I can connect to my server(Ubuntu 18.04) with PowerShell and Putty. but not with the other two ssh client I have (MobaXtrem,Bitvise). but when i turn on my VPN(SeedVpn) on ...
fristhon's user avatar
3 votes
1 answer
4k views

Adding ssh keys to a new server without having previously set up users on that server

I've setup a clean new VPS running Ubuntu 20.04 LTS with Hetzner and would like to access it via ssh. Here is what I've tried to do: I have added my public ssh key (passphrase-less) in Hetzner's ...
Karoh's user avatar
  • 155
2 votes
0 answers
393 views

Remove BOTH ssh key for IP and ssh key for FQDN from known_hosts

Is it possible to remove an ssh key from known_hosts both for the IP and for the FQDN of a machine, knowing only one of the 2? For example, I am on machine A, and I want to remove the public ssh key ...
Michele Piccolini's user avatar
1 vote
2 answers
4k views

Generating ssh-keys not creating key in PKCS1 format

I am attempting to create a public/private key pair using ssh-keygen. I need the key to be in PKCS1 format so that it states "BEING RSA PRIVATE KEY". No matter what I try it appears to only ...
IT_User's user avatar
  • 210
2 votes
1 answer
5k views

Reconnect automatically to a disconnected ssh session [closed]

I am new to this community , I am working on my iot project in which my microcontroller is working as a server, taking data and executing request. My client is end device (mobile,tablet) and I am ...
adil kampoo's user avatar
-1 votes
1 answer
395 views

How to uninstall ssh-keygen utility safely? [duplicate]

I am being tasked to remove ssh-keygen from Ubuntu servers and I don't want to break the computer. Can you please help, how to uninstall ssh-keygen utility safely? Thanks
Bhalu's user avatar
  • 3
1 vote
1 answer
7k views

Adding a ssh host key for a server name to `known_hosts` idempotently?

ssh-keygen -R $HOSTNAME can remove the ssh host key(s) from one's known_hosts. Can I add a specific host key (for a hostname/ip) to a known_hosts in an idempotent way? I want to script ssh'ing into a ...
Amandasaurus's user avatar
  • 32.3k
0 votes
1 answer
193 views

Why can't I authenticate my SSH connection?

I'm writing a bit confused because I've tried everything. Let me know if I'm missing any critical information for you to help me. I'm trying to SSH into my Cyberpower PDU (device probably not ...
Darren's user avatar
  • 1
7 votes
2 answers
3k views

Ubuntu 20.04 ssh-keygen unknown option -G unable to generate Diffie-Hellman parameters

I have noticed that the ssh-keygen for ubuntu 20.04 is missing the options for generating the Diffie-Hellman parameters. This is normally part of SSH hardening. Does anyone know why it has ...
Rob's user avatar
  • 131
3 votes
1 answer
2k views

Using 2 key pairs simultaneously for ssh authentication

I have a ssh server running on a raspberry pi. This ssh server can only be accessed by 1 user on my ubuntu laptop only. I have created 2 pairs of ssh keys using: ssh-keygen -t ed25519 -o -a 100 ssh-...
iLW's user avatar
  • 151
1 vote
1 answer
4k views

Is it okay to use same SSH keypair for different servers, and how not to?

Initially i tried (and failed) to generate a new SSH keypair for a new server. By default it offers to save it into ~/.ssh/id_rsa, which obviously i couldn't, so as to not overwrite my existing key. ...
Digital Ninja's user avatar
1 vote
2 answers
3k views

EC2: how to download the private key file for a user

I'm only working with terminal in order to create a user on a linux machine (ec2). When creating a new user and then generating an ssh key for this user ssh-keygen -f rsa I do this I then get a rsa....
Matt's user avatar
  • 43
0 votes
1 answer
194 views

How to adequately add identical public-private ssh key to a new client machine?

I have generated private and public key pair files (id_rsa, id_rsa.pub) using ssh-keygen command in a machine A, which is a client. I have tested my connection to server in machine A and it is working ...
Jorge Johanny Sáenz Noval's user avatar
2 votes
0 answers
4k views

SSH authentication Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

I'm having problem when I try to connect to a remote server using ssh with the following command: ssh -vvv -l user hostname -p XXXX I get the following result: OpenSSH_7.9p1 Debian-10+deb10u1, ...
Jorge Johanny Sáenz Noval's user avatar
2 votes
2 answers
318 views

how to create status of REMOTE HOST IDENTIFICATION HAS CHANGED when performing ssh to remote machine for testing

We want to cause the status from a remote Linux machine to return "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r", "@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\r", "@@@...
shalom's user avatar
  • 501
2 votes
3 answers
7k views

What can someone do with your SSH Private Key? [closed]

What exactly can someone do with my Private Key after they used my laptop to create a SSH Public Key? After reading a few websites, it looks like they can access a server pretending they are me when ...
LWYMUFC's user avatar
  • 21
2 votes
1 answer
3k views

OpenSSH Windows Server 2016

I am trying to install OpenSSH on a windows server machine. When i use this command: Get-WindowsCapability -Online | ? Name -like 'OpenSSH* I don't get this output: Name : OpenSSH.Client~~~~0.0.1....
Mouâd Harhar's user avatar
3 votes
3 answers
575 views

Differing ssh host key in Container-Optimized OS instance

I created a Container-Optimized OS instance in the Google Cloud. When I try to connect to it via ssh from outside the ssh host key fingerprint shown differs from the output of ssh-keygen -lf /etc/ssh/...
Jodka Lemon's user avatar
2 votes
1 answer
98 views

How to setup ssh for a couple of servers?

I'm pretty confused about how ssh really works, and I have already asked a couple of questions related to this, but I suspect I'm going in the XY-problem trap. So, what I want is this. I want to be ...
klutt's user avatar
  • 167
2 votes
1 answer
1k views

How to fetch ssh keys from servers?

I need to login to a host via ssh, get a keyfile, close the connection and then use the key to login without password on several machines. The underlying problem is that I need to perform tests on a ...
klutt's user avatar
  • 167
1 vote
0 answers
219 views

ssh key revocation list and -z version number

I've been reading about setting up an ssh certificate authority and controlling access via key revocation lists. And in the man page, it lists a -z option for specifying a version number for a key ...
dburke's user avatar
  • 143
7 votes
2 answers
8k views

How to verify the private key I have matches AWS keypair?

My AWS instance says it is configured to use the only keypair I have on my account and it has a fingerprint in the format of: 3c:64:a7:85:53:3f:81:1c:24:5a:d2:6a:5b:76:47:da:f3:14:63:88 I have a ...
csharpapple's user avatar
4 votes
1 answer
1k views

Several ed25519 keys with the same prefix

I have created a bunch of ed25519 keys through ssh-keygen to connect to different machines I have access to. However, I noticed that all of them begin with the same, rather long prefix: ...
CygnusX1's user avatar
  • 143
0 votes
1 answer
2k views

find ssh2 key fingerprint

How do I find the ssh fingerprint of a ssh2 key ? With a ssh-1 key I can do ssh-keygen -lf /path/to/keyfile. However when I convert the same key to a ssh2 key using ssh-keygen -e -f keyfile.pub > ...
letsc's user avatar
  • 101
0 votes
0 answers
101 views

SSH copy key from Raspberry Pi to Linux

I am trying to create a new ssh key, and copy it to a server, using a previously generated ssh key. /usr/bin/ssh-copy-id -f -i /home/pi/.ssh/newKey -o "IdentityFile=/home/pi/bob" [email protected] The ...
Milhous's user avatar
  • 133
0 votes
3 answers
544 views

How to have single ssh public-private key pair for a user across different servers?

I am working on standardizing different bits in our environment and as part of that would like to move towards ssh key based authentication. Currently we have individual accounts in each servers (...
Ram Kumar's user avatar
0 votes
1 answer
2k views

Why is the same private key file generating two different public key strings?

I have an ssh key pair that was generated to use as an access key for my GoCD CI/CD server. It was working but due to some configuration changes I made (moved the server out of container to a Linux ...
LegendaryDude's user avatar