4 ms·
ATM when testing deployment flow: function sd() { n=2 while [ $n -gt 0 ] do sed -i ''"${1}"'d' $HOME/.ssh/known_hosts n=$(($n-1)) do
by g0rfel 11y ago
ATM when testing deployment flow:
function sd() {
n=2
while [ $n -gt 0 ]
do
sed -i ''"${1}"'d' $HOME/.ssh/known_hosts
n=$(($n-1))
done
}
I like sed.
- anjanb 11y agocare to explain what the script does and how ncurses is involved here ?
- marios 11y agoIt removes a line from the known_host file. When spinning up a new VM/container or reaching a machine that has an IP/hostname you've used before (happens a lot in dev environments/NATed networks), you'll get a warning about a possible MITM attack. ncurses is not involved though.
- ta0967 11y agothat ''"${1}"'d' is needlessly complicated. this would do the same: "${1}d"
- balthamos89 11y agoIf you are careful, you can avoid that annoying problem altogether: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $1