title: How to execute ssh connect by script?
body: <p>I have local Windows 10 and remote Ubuntu server.</p>
  <p>I want to automate connection to server and write executable script witch connects by ssh to server and open new terminal from another server.</p>
  <p><strong>What it's supposed to look like</strong></p>
  <p>I double click on bat</p>
  <p><a href="https://i.stack.imgur.com/ZTwo4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZTwo4.png" alt="enter image description here" /></a></p>
  <p>And then script</p>
  <ol>
  <li>inits ssh connect</li>
  <li>writes password</li>
  <li>gives the user a terminal with a ready ssh connection.</li>
  </ol>
  <p>That is, it mimics the following</p>
  <p><a href="https://i.stack.imgur.com/L9feO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L9feO.png" alt="enter image description here" /></a></p>
  <p><strong>Problems</strong></p>
  <ol>
  <li>How to wait ssh password request? All commands executes immediately.</li>
  <li>(additional) can I write it in <code>.sh</code> script, run script, execute all in &quot;start&quot; terminal (from which I run <code>.sh</code> script) and then pass ssh control to invoked terminal?</li>
  </ol>
  <p>It's best if someone writes a ready-made script</p>