• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

supress

Disable Host Key Checking

February 9, 2020

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.

Filed Under: Linux Tagged With: key-gen, prompt, ssh, strickhostkeychecking, supress

  • Home
  • About
  • Archives

Copyright © 2023