Re-use my current Linode's IP address?
Is it possible to delete a Linode, and re-use it's IP address on another Linode created in the same datacenter?
1 Reply
There are a couple of ways to accomplish this:
Directly swap IP addresses with a new Linode
One is to create a new Linode before you delete the old one, and swap IP addresses between them by following the instructions in our guide. You could then delete the old Linode once you've verified that everything is configured properly, and any needed data has been transferred.Re-create the disk, instead of the Linode
As an alternative, you can also backup your Linode, delete it's disk (instead of deleting the entire Linode), and then restore your backup to the new disk.
One thing to be aware of is that when you re-use an IP on another Linode/disk, the first time you connect to it from any machine that was previously used to connect over SSH you will receive an error like the following:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is x.
Please contact your system administrator.
Add correct host key in /home/username/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/username/.ssh/known_hosts:5
RSA host key for <IP address or hostname> has changed and you have requested strict checking.
Host key verification failed.
This happens because SSH remembers the key for your Linode's previous OS, but is finding the new one instead, and assumes that something shady is happening. This is actually expected in this situation, and you can resolve it by removing the old entry from ~/.ssh/known_hosts
nano +<line number> ~/.ssh/known_hosts
Where <line number>
is the line number called out in the error. In the example error above, the line number would be 5:
Offending RSA key in /home/username/.ssh/known_hosts:5
Once you've removed that line (you can just press Ctrl-K
to remove the whole line at once), and saved the file, you will be able to connect over SSH.