Questions tagged [ssh-keygen]
The ssh-keygen tag has no usage guidance.
80
questions
1
vote
0
answers
84
views
"no matching key exchange method found. Their offer: diffie-hellman-group1-sha1". How to fix the client not the server
So we recently updated our server and found an old linux client was failing to login and generating a "no matching key exchange method found. Their offer: diffie-hellman-group1-sha1", on our ...
0
votes
3
answers
53
views
Where is the undo button in Linux? If I created an SSH key and copied the public key to a NAS, how would I undo or delete it?
I created an SSH key using ssh-keygen -t rsa.
Then I copied the key to the NAS, so I wouldn't have to enter a password using ssh-copy-id.
I realized that I did it for the wrong user, so now I need to ...
4
votes
1
answer
57
views
Is there a way to list what types of key ssh-keygen supports?
The man page for ssh-keygen on my system (Fedora 35) says that the following types of keys are supported:
-t dsa | ecdsa | ecdsa-sk | ed25519 | ed25519-sk | rsa
Specifies the type of key to ...
0
votes
0
answers
18
views
ssh-keygen: Provide CA passphrase without prompt during signing
I am using ssh-keygen operations similar to the following to sign SSH keys with a SSH CA:
# for SSH hosts
ssh-keygen -s $CACert -hn $FQDN $HostPubKey
# for SSH users
ssh-keygen -s $CACert -n $User $...
1
vote
2
answers
149
views
How to get the email of the logged in user when login occurs through SSH keys?
I’m using bash shell and Ubuntu 18.04. I SSH into the server using a fairly standard RSA public-private key set up, where I put my public key in the .ssh/authorized_keys file of the server, entry ...
0
votes
1
answer
119
views
how to create an ssh key-pair for a service account
I would like to generate an ssh key pair for a service account on one machine to access another machine via ssh.
When I generate the key with my user, my username is embedded in the public key.
E.g. ...
0
votes
1
answer
290
views
Unable to clone repo from gitlab into Oracle VirtualBox VM (CentOS) - host key verification failed
I am trying to clone a repo from gitlab into Oracle VirtualBox VM (CentOS) hosted on Win 10 machine.
Following are the steps:
generate key via ssh-keygen -t rsa and copy the key from generated id_rsa....
0
votes
1
answer
110
views
ssh-keygen -t rsa1 is failing
On Ubuntu 18.04
ssh-keygen -t rsa1 is failing with: unknown key type rsa1.
However when typing ssh-keygen -t rsa auto-complete gives me two options:
$ ssh-keygen -t rsa
rsa rsa1
How can I generate ...
5
votes
1
answer
841
views
How to verify fingerprint of Dropbear RSA host key?
When I connect to my Dropbear SSH server for the first time, I get the following message:
me@laptop:~$ ssh me@server
The authenticity of host 'server' can't be established.
RSA key fingerprint is ...
0
votes
1
answer
600
views
How to convert RFC4716 private keys to PEM private keys?
How to convert RFC4716 private keys to PEM private keys in ubuntu 20.04?
For our project we generated ssh keys on a device running the latest openssh software. JSch complained about authentication:
...
1
vote
1
answer
550
views
Reverse SSH works but not passwordless. Getting password prompt
I have two systems
Personal MacOS Laptop to be referred as system-Laptop having user laptopuser. It does not have "NAT"
Server Linux to be referred as system-Server having user serveruser ...
7
votes
3
answers
7k
views
sign_and_send_pubkey: signing failed for RSA key; from agent: agent refused operation
I have a new machine running debian sid on which I generated a new ssh key-pair. I wanted to find a convenient way to copy this new key-pair to various other machines using my old Ubuntu machine and ...
3
votes
0
answers
194
views
bash + how to avoiding duplicate entries in authorized_keys (ssh) in bash
Popular methods of adding an ssh public key to a remote host’s authorized_keys file include using the ssh-copy-id command, and using bash operators such as >> to append to the file.
An issue ...
6
votes
2
answers
2k
views
how to append public keys to remote host instead of copy it
I used in my bash script the follwing cli , in order to send the public key to remote machine
sshpass -p $pass scp /root/.ssh/authorized_keys root@$remote_host:~/.ssh/authorized_keys
but since we ...
1
vote
1
answer
138
views
SSH key accepted but remote host asks for password
I'm trying to get two server to connect via ssh keys.
These two servers had working ssh key authentication before, but one of them failed and was restored from a backup.
Since then, the key does not ...
0
votes
0
answers
257
views
How does one stop an ssh connection from hanging after changing keyfile permissions?
I am automating a sequence of ssh commands using bash and got them working when the script is called from the command line. An example call of ssh that was in the script is below.
ssh-keyscan -H $...
0
votes
1
answer
527
views
Trouble accessing remote server with public key
i am posting this question after extensive search in google to create public key and accessing server using public key, i am still unable to resolve this issue, as i am getting below error.
OpenSSH_7....
0
votes
1
answer
114
views
SSH key not working with a different name
When I'm trying to log in to a server using a public key for a ssh connection with a different name (other than id_rsa.pub, which is default name, I guess), it is not working and keeps asking for the ...
1
vote
1
answer
60
views
Can I add SSH key to my machine that another user generated on their machine?
Another user and I are both using the same Ubuntu machine. They created an SSH key and disabled password authentification. Now I can no longer ssh into my user account on the Ubuntu machine. He saved ...
0
votes
1
answer
19
views
Unix authentication not working using Unix keyfile for one user but working for other
My OS details:
NAME="Oracle Linux Server"
VERSION="7.4"
ID="ol"
VERSION_ID="7.4"
PRETTY_NAME="Oracle Linux Server 7.4"
I am trying to create a Unix keyfile for one of the defined users.
But it is ...
0
votes
2
answers
2k
views
Why ssh-keygen -f "~/.ssh/known_hosts" -R "hostname or ip" doesn't work? [duplicate]
When I type this command, the following message appears:
line 1 invalid key: -----BEGIN ...
~/.ssh/known_hosts is not a valid known hosts file.
Not replacing existing known_hosts file because of ...
1
vote
4
answers
4k
views
How to create .pem file - full process
I want to create a .pem file to connect to the server.
I know that I can use ssh-keygen, But I want to use it for a specific user, And I need a script that will do for me all process.
My need is to ...
0
votes
1
answer
90
views
how to create scenario of REMOTE HOST IDENTIFICATION HAS CHANGED when performing ssh to remote machine for testing
we want to cause status from linux remote machine that return
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r",
"@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\r",
"@@@@@@@...
0
votes
1
answer
139
views
ssh ask passwd also after copy-id
the problem is from his machine to this server, to other pc is all ok .the server correctly receive ssh connection from other pc whitout asking pass!
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
...
0
votes
2
answers
537
views
SSH keys that can be used only in one machine
My requirement is simple. I have generated a SSH key-pair (Public and Private) on a server say "A". Now I have uploaded my Public SSH key in AWS IAM and have generated a SSH key ID to connect to a ...
0
votes
1
answer
140
views
mounting sftp with ssh-keygen: Remote execution disabled; possible workarounds, other methods
I try to configure my system so that I can mount an sftp server without my password. I tried to do this with ssh-keygen and ssh-copy-id, but got an error.
$ ssh-keygen
...
$ ssh-copy-id user@sftp....
0
votes
1
answer
107
views
Add additional key pair for authentication
I need to have a new key pair for an additional host that will be allowed to login to the server ( but I can't share the existing pair due to security reasons).
Now, I created a new pair on the ...
5
votes
1
answer
2k
views
What does `ssh-keygen -r` do if a public key is not specified?
Short Question
I'm assuming that ssh-keygen -r hostname uses a default public key. I would have thought that it would default to ~/.ssh/id_rsa.pub, but that does not appear to be the case. So what is ...
1
vote
2
answers
196
views
SSH Password-protected Private Key Still Visible
I thought it was not be possible to view the content of a password-protected private key file without actually inputing a password.
Very surprisingly though, I can still see the content of my private ...
1
vote
2
answers
1k
views
SSH key not found on remote machine [closed]
I have the following setup: I have my laptop A, a computer B, and a remote machine C. C can only be accessed from B via ssh, B may be accessed via ssh from A or used directly. A is always used ...
0
votes
1
answer
3k
views
SSH login without password and without keys [duplicate]
Is it possible to configure a user to login via SSH without password and without using keys. Just typing "ssh user@server". I have tried some modifications with
Match User and with AllowUsers in /...
0
votes
1
answer
3k
views
show values of an ed22519 private key stored in OpenSSH format
(note this question uses both 'openssh' and 'openssl' in the text, I am not confusing the two.)
If I use openssh to general an RSA keypair (ssh-keygen) then I can use 'openssl rsa -in ...' to view ...
1
vote
0
answers
762
views
How to ssh-add elliptic curve key?
I'm trying to use a newly generated elliptic curve key with git version control for GitLab.
I am using a Xubuntu 16.04.
My OpenSSH version is: OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g 1 Mar ...
0
votes
1
answer
1k
views
Give default path for id_rsa in a shell script
I want to automate user creation along with the rsa key generation in a shell script. But while generating the rsa key we need to give inputs for these three things.
Enter file in which to save the ...
2
votes
2
answers
443
views
How to copy public key to the server that doesn't allow password?
I configured my server to not allow password authentication. Now I have a new machine in a remote location, how is it possible for me to generate an ssh key and do an ssh-copy-id to the server if the ...
-1
votes
2
answers
88
views
SSH key creation in stand alone machine
is it possible to create ssh keys (ssh-keygen) in stand alone machine. and then copy private ssh and public ssh key to client ssh directory and server ssh directory to perform password less ...
0
votes
1
answer
302
views
pros/cons between generating ssh keys on client vs server
if i'd like to have another user be able to ssh into my ec2 instance, is there any pros/cons between generating an ssh key for that user in the ec2 instance, and then copying the private key to that ...
0
votes
2
answers
1k
views
SSH key setup to login multiple hosts without password
I installed Putty on my local Windows machine A. I am connecting to remote linux server B from A. From B, I want to connect to multiple other remote machines C, D, E, F etc without entering password ...
0
votes
2
answers
2k
views
How can the, encrypted with AES, and BASE64 encoded, SSH private key, have size smaller than specified?
This might be obvious to some, but I wonder, if I generated 8192 key in size with:
ssh-keygen -t rsa -b 8192
How can the, encrypted with AES, and BASE64 encoded, SSH private key, have size smaller ...
0
votes
1
answer
62
views
After setting up ssh-keys, how can I ssh into the server such that the key-pair will be ignored?
I have key-pairs to ssh and scp into a server without entering my password. There are numerous tutorials on this, e.g.
https://alvinalexander.com/linux-unix/how-use-scp-without-password-backups-copy
...
12
votes
2
answers
32k
views
Add key to authorized_users without needing to restart sshd
I am trying to add a public key to a server but I don't want to restart the sshd service for it to take effect. The reason is that restarting the ssh service seems to be disruptive for other users who ...
0
votes
1
answer
724
views
I want to gather the host keys but ssh-keyscan command is not found on my linux. Anyway to achieve the same with some other commands
I want to gather the host keys but ssh-keyscan command is not found on my linux. Anyway to achieve the same with some other commands without adding this command explicitly.
I am running with Wind ...
43
votes
1
answer
4k
views
Why do portions of SSH public (and private) keys overlap?
Specifically, why are the first 25 characters of ssh Ed25519 public keys always the same?
For example, if I make 5 keys with ssh-keygen -o -a 100 -t ed25519, the first 25 characters are always ...
12
votes
2
answers
20k
views
How to compare different SSH fingerprint (public key hash) formats?
When I log in to an SSH server/host I get asked whether the hash of its public key is correct, like this:
# ssh 1.2.3.4
The authenticity of host '[1.2.3.4]:22 ([[1.2.3.4]:22)' can't be established.
...
3
votes
0
answers
23k
views
OpenSSH private key screwed up: Load key: invalid format [closed]
When attempting to change my SSH private key passphrase, I get the following error message from ssh:
Load key "/home/me/.ssh/id_rsa.pub": invalid format
The password encryption still works and my ...
0
votes
3
answers
557
views
Linux: How do I upgrade ssh-keygen?
I want to make use of the updated version of ssh-keygen because that includes a hashing feature for fingerprints like so:
ssh-keygen -E md5 -lf ~/.ssh/id_rsa.pub
But my current version doesn't ...
2
votes
2
answers
89
views
Use X SSH key when logging in to Y remote user?
I'm looking for a way to set a specific SSH key while logging to a remote host with a particular username. Is this possible within the SSH config file?
For example:
Use key "id_rsa-test" for ...
0
votes
2
answers
2k
views
Setting SSH trust between 2 service accounts
I am trying to setup SSH trust (for passwordless authentication) between
user1@host1 TO user2@host2 so that user1@host1 can execute remote scripts as user2@host2.
Both accounts, user1 and user2 are ...
3
votes
1
answer
1k
views
SSH asking me for passphrase which doesn't have any passphrase
I have generated the keys in Ubuntu 14.04 system using the following commands to use with ssh.
ssh-keygen -t rsa -b 2048
openssl rsa -in id_rsa -outform pem > pk_rsa.pem
openssl rsa -in pk_rsa....
0
votes
1
answer
94
views
SSH key required for every connection
I installed an ssh key on my machine to connect to a server, why does it ask me to insert the password for that key even if I am trying to connect to a different server?