Skip to main content
edited tags; edited title
Link
Gilles 'SO- stop being evil'
  • 865.3k
  • 205
  • 1.8k
  • 2.3k

I have some questions about ssh SSH key-based authentication.: known_hosts vs authorized_keys

fixed grammar and reworded some things to make them easier to understand
Source Link

Comprehension I have some questions ragardingabout ssh keyskey-based authentication.

I read about setting up ssh keys in linuxLinux and have some comprehension problemsquestions. Correct me if I state something wrong:I'm wrong…

For example,Let's say host tr-lgto wants to connect to host tr-mdm using ssh. If we want to be sure that it's the real tr-mdm, we generate a pair of keys on tr-mdm and we add the public key to file known_hostsknown_hosts on tr-lgto. If tr-mdm wants to check that it's the real tr-lgto is real, thanthen tr-lgto havehas to generate pair of keysa keypair and add the public key should be added to authorized_keys fileauthorized_keys on tr-mdm.

Question 1: There is no separation between usersuser field in file known_hosts, it's just IP addressaddresses and dns namehostnames. tr-mdm canmight have a lot of users, each with itstheir own .ssh.ssh folder. Should we add allthe public keyskey to known_hostseach of the known_hosts files?

Question 2: I found commandthat ssh-keyscan -t rsa tr-mdm whichwill return methe public key of tr-mdm. It's not clear public key of whichHow do I know what user. this key belongs to? Moreover, the public key in /root/.ssh//root/.ssh/ is different from what that command returns. How can itthis be?

Comprehension questions ragarding ssh keys

I read about setting up ssh keys in linux and have some comprehension problems. Correct me if I state something wrong:

For example, host tr-lgto wants to connect to host tr-mdm using ssh. If we want to be sure that it's real tr-mdm we generate a pair of keys on tr-mdm and we add public key to file known_hosts on tr-lgto. If tr-mdm wants to check that tr-lgto is real, than tr-lgto have to generate pair of keys and public key should be added to authorized_keys file on tr-mdm.

Question 1: There is no separation between users in file known_hosts, it's just IP address and dns name. tr-mdm can have a lot of users with its own .ssh folder. Should we add all public keys to known_hosts?

Question 2: I found command ssh-keyscan -t rsa tr-mdm which return me public key of tr-mdm. It's not clear public key of which user. Moreover, public key in /root/.ssh/ is different from what command returns. How can it be?

I have some questions about ssh key-based authentication.

I read about setting up ssh keys in Linux and have some questions. Correct me if I'm wrong…

Let's say host tr-lgto wants to connect to host tr-mdm using ssh. If we want to be sure that it's the real tr-mdm, we generate a pair of keys on tr-mdm and we add the public key to known_hosts on tr-lgto. If tr-mdm wants to check that it's the real tr-lgto, then tr-lgto has to generate a keypair and add the public key to authorized_keys on tr-mdm.

Question 1: There is no user field in file known_hosts, just IP addresses and hostnames. tr-mdm might have a lot of users, each with their own .ssh folder. Should we add the public key to each of the known_hosts files?

Question 2: I found that ssh-keyscan -t rsa tr-mdm will return the public key of tr-mdm. How do I know what user this key belongs to? Moreover, the public key in /root/.ssh/ is different from what that command returns. How can this be?

Source Link
damluar
  • 483
  • 1
  • 6
  • 11

Comprehension questions ragarding ssh keys

I read about setting up ssh keys in linux and have some comprehension problems. Correct me if I state something wrong:

For example, host tr-lgto wants to connect to host tr-mdm using ssh. If we want to be sure that it's real tr-mdm we generate a pair of keys on tr-mdm and we add public key to file known_hosts on tr-lgto. If tr-mdm wants to check that tr-lgto is real, than tr-lgto have to generate pair of keys and public key should be added to authorized_keys file on tr-mdm.

Question 1: There is no separation between users in file known_hosts, it's just IP address and dns name. tr-mdm can have a lot of users with its own .ssh folder. Should we add all public keys to known_hosts?

Question 2: I found command ssh-keyscan -t rsa tr-mdm which return me public key of tr-mdm. It's not clear public key of which user. Moreover, public key in /root/.ssh/ is different from what command returns. How can it be?