Question

I have two server server1 server2

want to login server 2 from server 1,I added both pub key (ssh_host_rsa_key.pub) in one another server in .ssh/authorized_keys.

when i run #cd /etc/ssh;ls -ltr able to see below file sshd_config ssh_config moduli ssh_host_key.pub ssh_host_key ssh_host_rsa_key.pub ssh_host_rsa_key ssh_host_dsa_key.pub ssh_host_dsa_key

Was it helpful?

Solution

Host keys ssh_host_rsa_key.pub are stored automatically by ssh in known_hosts files; they are not intended to be managed by the user.

The authorized_keys is intended for user identity files. What you really want to do is to use ssh-keygen to generate an identity file representing you:

ssh-keygen -t ecdsa

Two identity files are generated: the private key id_ecdsa and the public key id_ecdsa.pub. Copy the public key into server2's .ssh/authorized_keys.

If you created a passphrase for your identity files, that's what you will be using from now on. Otherwise, your login will be password-less.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top