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?