To be more accurate you should be setting the domain name and using
crypto key generate rsa modulus 2048 to enable SSH, your method is just a hack workaround that really has no practical purpose.
Usually you would use copy certs used for VPNs if it’s a CA router and just regenerate the selfsigned stuff.
Last question sorry for bothering you , will choosing random ip domain names to each router and switch in real life scenario for ex inside some company , effect anything on devices? Telnet ssh, do i need to use one unique domain name for all devices?
My example is it working.
R01#ssh -l admin 10.1.2.2 Password: R02>
What is your thought process here, are you just trying to understand SSH and thinking up weird scenarios?
Am trying to understand why copying all configs from routers or switch with ssh enabled through ip http secure server doesnt work on other devices, i know the ip domain name method to create keys, and ip http secure server also generate keys, but when you copy all configs from that devices which ssh works on it , to another devices the ssh fails and the ssh isnt enabled, even though you copied all configs and you can see the same keys in the two devices, and both have ip http secure server on, but the one with copied configs have its ssh disabled and since we copied the keys, the ip http secure server doesnt generate another set of keys and ssh stays disabled, so the copying process fails, and there is no point in copying tye keys and like you said just do ip http secure server on each device so they generate keys and enable ssh