title: Capistrano 3 sudo task
body: <p>I want to write a recipe with Capistrano 3 executing a task on the remote server with sudo.</p>
  
  <p>With Capistrano 2 this could be done for example:</p>
  
  <pre><code>default_run_options[:pty] = true
  
  task :hello do
    run "#{sudo} cp ~/something /something"
  end
  </code></pre>
  
  <p>With Capistrano 3 I found:</p>
  
  <pre><code>set :pty, true
  </code></pre>
  
  <p>But I could not get to execute a task running with sudo.</p>
  
  <p>How can I run a task with sudo?</p>