title: Bash: controlling SSH
body: <p>I have this bash file, which asks for IP, password, etc. for OpenSSH to a device.</p>
  
  <p>Now, if i use <code>ssh root@ip</code>, i have to enter the password. This is really irritating. Secondly; i cannot let my script send commands to it.</p>
  
  <p>This is what i want-></p>
  
  <ol>
  <li><p>Not the password thing; i already found something; but it tells me the commands are not found?:</p>
  
  <p><code>#!/usr/bin/expect -f</code></p>
  
  <p><code>spawn ssh root@$IPADDR</code></p>
  
  <p><code>expect "password:"</code></p>
  
  <p><code>sleep 1</code></p>
  
  <p><code>send "$rpass\r"</code></p>
  
  <ol start="2">
  <li><p>I want the user to be able to see some menus where it can choose from; after that; every command is done for him. So like a new window, or something like that?</p></li>
  <li><p>I do not want to use:
  -Any external stuff
  -No extra editing of the SSH connection</p></li>
  </ol></li>
  </ol>
  
  <p>BASH INFO: GNU Bash, v. 4.0.33(1)-release (i486-pc-linux-gnu), running on Linux Mint. But it got to be available for several linux distro's, and also on Mac?</p>