Reinstall Ubuntu and Keep SSH keys [duplicate]
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
0
down vote
favorite
This question already has an answer here:
How do I backup ssh keys?
3 answers
I'm currently running Ubuntu 17.04 on my VPS. I want to go back to 16.04 since 17.04 is at end of life. I have a few remote systems that automatically log into this server using authorized keys. If I start fresh, how can I make sure those machines will still be able to log into the server. I do not have physical access to the remote machines.
ssh
marked as duplicate by David Foerster, user68186, Zanna, Eric Carvalho, Charles Green Feb 6 at 14:02
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
up vote
0
down vote
favorite
This question already has an answer here:
How do I backup ssh keys?
3 answers
I'm currently running Ubuntu 17.04 on my VPS. I want to go back to 16.04 since 17.04 is at end of life. I have a few remote systems that automatically log into this server using authorized keys. If I start fresh, how can I make sure those machines will still be able to log into the server. I do not have physical access to the remote machines.
ssh
marked as duplicate by David Foerster, user68186, Zanna, Eric Carvalho, Charles Green Feb 6 at 14:02
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
I'd recommend simply backing up your.ssh
folders and copying them into the new installation afterwards.
â Byte Commander
Feb 5 at 13:45
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This question already has an answer here:
How do I backup ssh keys?
3 answers
I'm currently running Ubuntu 17.04 on my VPS. I want to go back to 16.04 since 17.04 is at end of life. I have a few remote systems that automatically log into this server using authorized keys. If I start fresh, how can I make sure those machines will still be able to log into the server. I do not have physical access to the remote machines.
ssh
This question already has an answer here:
How do I backup ssh keys?
3 answers
I'm currently running Ubuntu 17.04 on my VPS. I want to go back to 16.04 since 17.04 is at end of life. I have a few remote systems that automatically log into this server using authorized keys. If I start fresh, how can I make sure those machines will still be able to log into the server. I do not have physical access to the remote machines.
This question already has an answer here:
How do I backup ssh keys?
3 answers
ssh
ssh
asked Feb 5 at 13:15
user3735849
31
31
marked as duplicate by David Foerster, user68186, Zanna, Eric Carvalho, Charles Green Feb 6 at 14:02
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by David Foerster, user68186, Zanna, Eric Carvalho, Charles Green Feb 6 at 14:02
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
I'd recommend simply backing up your.ssh
folders and copying them into the new installation afterwards.
â Byte Commander
Feb 5 at 13:45
add a comment |Â
I'd recommend simply backing up your.ssh
folders and copying them into the new installation afterwards.
â Byte Commander
Feb 5 at 13:45
I'd recommend simply backing up your
.ssh
folders and copying them into the new installation afterwards.â Byte Commander
Feb 5 at 13:45
I'd recommend simply backing up your
.ssh
folders and copying them into the new installation afterwards.â Byte Commander
Feb 5 at 13:45
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
You need to save your ~/.ssh/authorized_keys
file for the user your other servers use to login, and copy that on your new VPS. That way your SSH keys will still be valid, and the other servers will be able to login.
However, with a new install you will also get a new SSH fingerprint, and the hosts will very likely refuse to log into your new VPS.
To remedy that you can either add -o StrictHostKeyChecking=no
to your SSH command (or via ~/.ssh/config
) on each and every host - which I don't recommend.
Or stop your servers from panicking about the new fingerprint, you can just re-create it:
The server credentials, that make up the "fingerprint" for SSH are actually just keypairs defined in your /etc/ssh/sshd_config
:
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
Copy these files to your new VPS (with their .pub variants), make sure the paths in sshd_config
point to them and the permissions (600
and 644
for the .pubs) are correct, reload sshd
on your new VPS, and you'll have essentially "cloned" your SSH setup.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You need to save your ~/.ssh/authorized_keys
file for the user your other servers use to login, and copy that on your new VPS. That way your SSH keys will still be valid, and the other servers will be able to login.
However, with a new install you will also get a new SSH fingerprint, and the hosts will very likely refuse to log into your new VPS.
To remedy that you can either add -o StrictHostKeyChecking=no
to your SSH command (or via ~/.ssh/config
) on each and every host - which I don't recommend.
Or stop your servers from panicking about the new fingerprint, you can just re-create it:
The server credentials, that make up the "fingerprint" for SSH are actually just keypairs defined in your /etc/ssh/sshd_config
:
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
Copy these files to your new VPS (with their .pub variants), make sure the paths in sshd_config
point to them and the permissions (600
and 644
for the .pubs) are correct, reload sshd
on your new VPS, and you'll have essentially "cloned" your SSH setup.
add a comment |Â
up vote
1
down vote
accepted
You need to save your ~/.ssh/authorized_keys
file for the user your other servers use to login, and copy that on your new VPS. That way your SSH keys will still be valid, and the other servers will be able to login.
However, with a new install you will also get a new SSH fingerprint, and the hosts will very likely refuse to log into your new VPS.
To remedy that you can either add -o StrictHostKeyChecking=no
to your SSH command (or via ~/.ssh/config
) on each and every host - which I don't recommend.
Or stop your servers from panicking about the new fingerprint, you can just re-create it:
The server credentials, that make up the "fingerprint" for SSH are actually just keypairs defined in your /etc/ssh/sshd_config
:
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
Copy these files to your new VPS (with their .pub variants), make sure the paths in sshd_config
point to them and the permissions (600
and 644
for the .pubs) are correct, reload sshd
on your new VPS, and you'll have essentially "cloned" your SSH setup.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You need to save your ~/.ssh/authorized_keys
file for the user your other servers use to login, and copy that on your new VPS. That way your SSH keys will still be valid, and the other servers will be able to login.
However, with a new install you will also get a new SSH fingerprint, and the hosts will very likely refuse to log into your new VPS.
To remedy that you can either add -o StrictHostKeyChecking=no
to your SSH command (or via ~/.ssh/config
) on each and every host - which I don't recommend.
Or stop your servers from panicking about the new fingerprint, you can just re-create it:
The server credentials, that make up the "fingerprint" for SSH are actually just keypairs defined in your /etc/ssh/sshd_config
:
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
Copy these files to your new VPS (with their .pub variants), make sure the paths in sshd_config
point to them and the permissions (600
and 644
for the .pubs) are correct, reload sshd
on your new VPS, and you'll have essentially "cloned" your SSH setup.
You need to save your ~/.ssh/authorized_keys
file for the user your other servers use to login, and copy that on your new VPS. That way your SSH keys will still be valid, and the other servers will be able to login.
However, with a new install you will also get a new SSH fingerprint, and the hosts will very likely refuse to log into your new VPS.
To remedy that you can either add -o StrictHostKeyChecking=no
to your SSH command (or via ~/.ssh/config
) on each and every host - which I don't recommend.
Or stop your servers from panicking about the new fingerprint, you can just re-create it:
The server credentials, that make up the "fingerprint" for SSH are actually just keypairs defined in your /etc/ssh/sshd_config
:
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
Copy these files to your new VPS (with their .pub variants), make sure the paths in sshd_config
point to them and the permissions (600
and 644
for the .pubs) are correct, reload sshd
on your new VPS, and you'll have essentially "cloned" your SSH setup.
edited Feb 6 at 7:25
answered Feb 5 at 13:55
Robert Riedl
2,740623
2,740623
add a comment |Â
add a comment |Â
I'd recommend simply backing up your
.ssh
folders and copying them into the new installation afterwards.â Byte Commander
Feb 5 at 13:45