-1

If I add an ssh pubic key to a server using ssh-copy-id:

ssh-copy-id -i ~/.ssh/my_id.pub user@server123.com

Will I still be able to connect to the server using the hostname server123.com if the hostname changes to myproductionsite.com, or will I need to re-add public key again after the change?

thanks

user4984
  • 123
  • 4

1 Answers1

3

You really need to get your terminology straight.

  • You want to change the hostname and have myproductionsite.com point to your servers IP, I guess.
  • Also, your question appears to be if you still will be able to authenticate with the public key after this change and not if an already running SSH session will survive this (that's what we call a connection).

If this correct, the answer will be that this will continue to work, but you will get the message about an unknown host key when first connection to myproductionsite.com via SSH which you will have to confirm.

Sven
  • 98,649
  • 14
  • 180
  • 226
  • Thanks SvW - I've updated my question. And yes, I was asking about reconnecting, not if an established connection would be broken. – user4984 Aug 04 '14 at 19:59