title: Is it possible to automatically input value to the terminal when using an ssh connection?
body: <p>I have the username, ip addresses and passwords for specific servers. I want to connect to these servers using sshpass with ssh connection. It would be my first connection to these servers, so ssh will save their fingerprints. I need to write code that would handle any prompt asking me if I want to continue connecting and for the password.</p>
  
  <p>The problem is that since its a new connection, it will prompt if I want to continue and I don't want to type "yes" for every server. I will be dealing with over 50 servers at one point and I don't want to manually type "yes" and then the password. </p>
  
  <p>This is a (dummy) code of what I actually have in bash:</p>
  
  <pre><code>ip="192.168.111.111"
  user="user"
  password="password"
  
  sshpass -p $password $user@$ip "exit"
  </code></pre>
  
  <p>I get an error of <code>Host key verification failed</code> for this code.</p>
  
  <p>So then I tried: <code>$user@$ip "exit"</code> and I get a prompt asking me is I want to continue connecting (yes/no). I don't want to type "yes" each time and then the password for each server. Can have some code that can manually do this for you? </p>
  
  <p>Thanks. Let me know if further explanation is required. Also, I want to avoid using the Expect tool.</p>