Connecting to a remote server using SSH without prompt

how-to
19 Jun 2023

When you try to connect to SSH server, you might have seen the following prompt.

$ ssh user@remote-server

If you are connecting to the remote server for the first time, you will a prompt confirming the authenticity of the host.

SSH auth prompt

However, this will be problematic in case of CI/CD servers, where you need to connect to the remote server without any prompt.

To do that, you can use the following command.

$ ssh -o StrictHostKeyChecking=no user@remote-server