Depending on your ssh client, you can set the StrictHostKeyChecking option to no on the command line, and/or send the key to a null known_hosts file. You can also set these options in your config file, either for all hosts or for a given set of IP addresses or host names.
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
EDIT
As @IanDunn notes, there are security risks to doing this. If the resource you’re connecting to has been spoofed by an attacker, they could potentially replay the destination server’s challenge back to you, fooling you into thinking that you’re connecting to the remote resource while in fact they are connecting to that resource with your credentials. You should carefully consider whether that’s an appropriate risk to take on before altering your connection mechanism to skip HostKeyChecking.
Related Posts:
- ssh: The authenticity of host ‘hostname’ can’t be established
- Git: How to solve Permission denied (publickey) error when using Git?
- How to solve “sign_and_send_pubkey: signing failed: agent refused operation”?
- Git error: “Host Key Verification Failed” when connecting to remote repository
- we did not send a packet, disable method
- “Add correct host key in known_hosts” / multiple ssh host keys per hostname?
- What’s the difference between authorized_keys and authorized_keys2?
- how do you create an ssh key for another user?
- What significance does the user/host at the end of an SSH public key file hold?
- Why does my OpenSSH key fingerprint not match the AWS EC2 console keypair fingerprint?
- How do I validate an RSA SSH public key file (id_rsa.pub)?
- SSH Allow Password For One User, Rest Only Allow Public Keys [duplicate]
- Why is SSH password authentication a security risk?
- ssh : Permission denied (publickey,gssapi-with-mic)
- ssh connect Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)
- Could not open a connection to your authentication agent
- Could not open a connection to your authentication agent
- How to establish ssh key pair when “Host key verification failed”
- Copying a local file from Windows to a remote server using scp
- AWS – Disconnected : No supported authentication methods available (server sent :publickey)
- How to set ssh timeout?
- Using putty to scp from windows to Linux
- mysql_config not found when installing mysqldb python interface
- SSH -X “Warning: untrusted X11 forwarding setup failed: xauth key data not generated”
- X11 forwarding request failed on channel 0
- Permission denied (publickey,keyboard-interactive)
- “Key is invalid” message on GitHub
- mysql_config not found when installing mysqldb python interface
- mysql_config not found when installing mysqldb python interface
- Pseudo-terminal will not be allocated because stdin is not a terminal
- How to download a file from server using SSH?
- How to fix request failed on channel 0
- How to scp in Python?
- connect to host localhost port 22: Connection refused
- channel 3: open failed: connect failed: Connection refused
- Getting “socket.error: [Errno 61] Connection refused” python paramiko
- PuTTY PSCP error “Local to local copy not supported” when username contains a slash
- How to specify the private SSH-key to use when executing shell command on Git?
- Starting ssh-agent on Windows 10 fails: “unable to start ssh-agent service, error :1058”
- X Error of failed request: BadValue (integer parameter out of range for operation)
- Getting stty: standard input: Inappropriate ioctl for device when using scp through an ssh tunnel
- Copying files using rsync from remote server to local machine
- Copying files from server to local computer using SSH
- Could not create work tree dir ‘example.com’.: Permission denied
- How to add RSA key to authorized_keys file?
- SSH to Vagrant box in Windows?
- How to use Sublime over SSH
- key_load_public: invalid format
- Differences between SFTP and “FTP over SSH”
- Use qdel to delete all my jobs at once, not one at a time
- Paramiko’s SSHClient with SFTP
- EC2 ssh Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
- Automating command/script execution using PuTTY
- Why does WordPress need my private ssh key to update?
- Public and Private Keys are Incorrect for user
- Configure WordPress to connect to Mysql DB using SSH tunneling
- Failure to establish connection when provisioning via ansible-playbook server.yml
- Upgraded to php7.0, now ssh updates don’t work [closed]
- enable SFTP via SSH keys in wordpress
- Server configuration for WordPress – Do I need install PHP-SSH extensions for WordPress on Fedora28?
- Unable to update WordPress or install plugins/themes
- SSH Server with WordPress
- AWS Lightsail WordPress – connect to database on instance using mysqli
- How To Upload Existing WordPress Site To WordPress Multisite Using SSH
- Can I use WP-CLI from a remote computer?
- Public and Private keys incorrect for user
- SSH vs WordPress
- Configuring WordPress permissions for easy updates
- SSH git — How to pull a folder from repo, but not delete other directories & files on deployment server [closed]
- How to automate SSH login with password?
- ssh returns “Bad owner or permissions on ~/.ssh/config”
- How do I change my private key passphrase?
- Can I automatically add a new host to known_hosts?
- Can I nohup/screen an already-started process?
- Create a public SSH key from the private key?
- Is it normal to get hundreds of break-in attempts per day?
- SSH use only my password, Ignore my ssh key, don’t prompt me for a passphrase
- ssh-agent forwarding and sudo to another user
- how to disable SSH login with password for some users?
- Non interactive git clone (ssh fingerprint prompt) [duplicate]
- What does “Warning: untrusted X11 forwarding setup failed: xauth key data not generated” mean when ssh’ing with -X?
- How do I make ssh fail rather than prompt for a password if the public-key authentication fails?
- OpenSSH: Difference between internal-sftp and sftp-server
- SSH Suddenly returning Invalid format
- What is a good SSH server to use on Windows? [closed]
- SSH keypair generation: RSA or DSA?
- How to recover from “Too many Authentication Failures for user root”
- Does getting disconnected from an SSH session kill your programs?
- Login without running bash_profile or bashrc
- ssh tunnel refusing connections with “channel 2: open failed”
- Show all users and their groups/vice versa
- How can I fully log all bash scripts actions?
- What’s wrong with always being root?
- Add comment to existing SSH public key
- Hundreds of failed ssh logins
- ssh connection takes forever to initiate, stuck at “pledge: network”
- protocol version mismatch — is your shell clean?
- bad ownership or modes for chroot directory component
- Is it possible to use rsync over sftp (without an ssh shell)?
- Why is ssh agent forwarding not working?