| 29 | Similarly to Linux, you will need to edit your ~/.ssh/known_hosts file. The error message will specify the line number of the "offending" key; for example, |
| 30 | |
| 31 | {{{ |
| 32 | Offending key in /Users/Jack/.ssh/known_hosts:26 |
| 33 | }}} |
| 34 | |
| 35 | Here, 26 is the line number of the "offending" key. Edit ~/.ssh/known_hosts and delete the line. To do this using the vim text editor, type the following at the prompt in Terminal: |
| 36 | |
| 37 | {{{ |
| 38 | vi ~/.ssh/known_hosts |
| 39 | }}} |
| 40 | |
| 41 | When the file opens, type |
| 42 | |
| 43 | {{{ |
| 44 | :26 |
| 45 | }}} |
| 46 | |
| 47 | replacing "26" with your offending line number to jump to that line in the file. The name or IP address of the server you were trying to connect to should appear at the beginning of this line. Type |
| 48 | |
| 49 | {{{ |
| 50 | dd |
| 51 | }}} |
| 52 | |
| 53 | to delete the line, then type |
| 54 | |
| 55 | {{{ |
| 56 | :wq |
| 57 | }}} |
| 58 | |
| 59 | to save your changes and quit. Then, try to connect to the server again. You'll likely get a message saying that the authenticity of the host cannot be established; type "yes" to continue connecting and the new host key will be saved into your known_hosts file. |
| 60 | |