Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


If you are careful, you can avoid that annoying problem altogether:

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $1


that

    ''"${1}"'d'
is needlessly complicated. this would do the same:

    "${1}d"


care to explain what the script does and how ncurses is involved here ?


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: