Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Archives for supress

February 9, 2020

Disable Host Key Checking

How to suppress typing “yes” when prompted by ssh.

#!/bin/bash
ssh-keygen -f "/home/user/.ssh/known_hosts" -R "yourdomain.com" 
ssh -o "StrictHostKeyChecking=no" -i "keys/key.pem" ubuntu@domain.com

#!/bin/bash ssh-keygen -f "/home/user/.ssh/known_hosts" -R "yourdomain.com" ssh -o "StrictHostKeyChecking=no" -i "keys/key.pem" ubuntu@domain.com

  1. First remove old keys in the know_hosts file.
  2. Use “StrictHostKeyChecking” to suppress prompt.

  • Cloud
  • Linux
  • Git

Copyright © 2012–2021