Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8339895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:00:41+00:00 2026-06-09T05:00:41+00:00

Consider the following sudo call using Fabric: def ls(): output = sudo(‘ls /tmp/’, user

  • 0

Consider the following sudo call using Fabric:

def ls():
    output = sudo('ls /tmp/', user = 'someone', shell = True)
    print "Output:", output

Execute this using fab and enter a wrong password the first time you are prompted by sudo. You’ll see an error message and sudo will ask you for your password again. Enter the correct password the second time. The session looks something like this:

$ fab ls
[user@server] Executing task 'ls'
[user@server] sudo: ls /tmp/
[user@server] out: sudo password: 

[user@server] out: Sorry, try again.
[user@server] out: sudo password: 

[user@server] out: hsperfdata_someone

Output: Sorry, try again.

Done.

Note how the value of output is the first message printed by sudo when the wrong password is entered (“Sorry, try again.”). It doesn’t contain the subsequent correct output (“hsperfdata_someone”).

Am I doing something wrong? Is there a better way to capture output correctly in such cases?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T05:00:45+00:00Added an answer on June 9, 2026 at 5:00 am

    I’d say that is possibly a bug to be reported, but you could look to this section for some different combinations to try.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider following string Some string with quotes and \pre-slashed\ quotes Using regex, I want
Consider following scenario: I have RESTful URL /articles that returns list of articles user
Consider following tables: How to skip and take groups from the table? Tried using
How to get the underlying type of an Observable collection using reflection? Consider following
Consider following source files 1.cpp #include <iostream> using namespace std; struct X { X()
Consider following situation: there is ComboBox and a filter TextBox, then user types a
Consider following object, object A { def setX(x:Int) = { val x1 = x
please consider following code #include <iostream> using namespace std; class Digit { private: int
Please let us consider following code: #include <iostream> using namespace std; union{ int i;
consider following codes and classes: using System.Collections.Generic; using System.IO; using System.Linq; using System.Xml.Serialization; namespace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.