19 Jun 2023

Connecting to a remote server using SSH without prompt

  • cli
  • productivity
  • howto

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

$ ssh user@remote-server

If you 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