Re-use my current Linode's IP address?

Linode Staff

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:

  1. 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.

  2. 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.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct