title: Netmiko for Linux - sending the sudo password
body: <p>I could not figure out how to send the sudo password when using <code>netmiko</code>.</p>
  
  <p>I want for example to run:</p>
  
  <pre><code>sudo apt-get -y install apache2
  </code></pre>
  
  <p>Linux will ask for the password so I must specify it in my python script.</p>
  
  <pre><code>from netmiko import ConnectHandler
  
  
  linux = {
          'device_type': 'linux',
          'ip': '192.168.0.134',
          'username': 'u1',
          'password': 'testpass',
          'port': 229,
          'verbose':True
          }
  
  connection = ConnectHandler(**linux)
  output = connection.send_command('sudo apt-get update &amp;&amp; apt-get -y install apache2')
  print(output)
  connection.disconnect()
  </code></pre>