From 50aef1c83c8308cc4e5f324060d90793c2c502d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20P=C3=A9rez-Su=C3=A1rez?= Date: Tue, 2 Jun 2020 19:41:28 +0100 Subject: [PATCH 1/2] adds an alternative to delete lines using sed --- mkdocs-project-dir/docs/howto.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mkdocs-project-dir/docs/howto.md b/mkdocs-project-dir/docs/howto.md index ee4ca65ca..280eb80a7 100644 --- a/mkdocs-project-dir/docs/howto.md +++ b/mkdocs-project-dir/docs/howto.md @@ -110,6 +110,13 @@ press `Ctrl` and then the letter `o`. # to open the file for editing in pico pico ~/.ssh/known_hosts ``` + +Alternativaly, you can use `sed` to remove that line: +``` +sed -i.bak '11d' ~/.ssh/known_hosts +``` +where 11 refers to the line number you want to remove. + Once you have removed the old host key you will be able to ssh in again. The first time you log in to an unknown server you will get a message like this: ``` From ad03e7bfa9d584b2c85cc2397f657952f48c6978 Mon Sep 17 00:00:00 2001 From: David Perez-Suarez Date: Mon, 29 Jun 2020 20:40:52 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9D=20Improves=20explanation=20abo?= =?UTF-8?q?ut=20`sed`=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mkdocs-project-dir/docs/howto.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mkdocs-project-dir/docs/howto.md b/mkdocs-project-dir/docs/howto.md index 280eb80a7..8ba8dec14 100644 --- a/mkdocs-project-dir/docs/howto.md +++ b/mkdocs-project-dir/docs/howto.md @@ -115,7 +115,9 @@ Alternativaly, you can use `sed` to remove that line: ``` sed -i.bak '11d' ~/.ssh/known_hosts ``` -where 11 refers to the line number you want to remove. +where 11 refers to the line number you want to delete (`d`). With `-i.bak` we are saving the +original file with a `.bak` extension. If you don't want to keep a backup copy remove `.bak` from +the `-i` argument. Once you have removed the old host key you will be able to ssh in again. The first time you log in to an unknown server you will get a message like this: