bugGNU Parallel - build and execute command lines from standard input in parallel - Bugs: bug #37617, feature request: support for sudo...

 
 

bug #37617: feature request: support for sudo over ssh

Submitted by:  Ben Booth <benwbooth>
Submitted on:  Tue 23 Oct 2012 01:35:01 AM UTC  
 
Category: NoneSeverity: 1 - Wish
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 03 Jan 2013 01:10:29 PM UTC, comment #4:

This will allow for combined commands (id;id):

cat passwd | parallel -S lo --pipe -q sudo -S bash -c id\;id

--onall and --pipe must still be combineable. Not sure how to do that best.

Currently we read a block and fork. Will it be OK if we read a block, copy the block to --onall, fork, and then read the next block? It will be sufficient for holding the password.

The problem would be if the command expects to get a copy of all the stdin (e.g. wc).

Ole Tange <tange>
Project Administrator
Wed 24 Oct 2012 10:56:57 AM UTC, comment #3:

The good news is that GNU Parallel supports profiles, so you can have a 'sudo' profile:

parallel -J sudo -S .. do_sudo_stuff

Ole Tange <tange>
Project Administrator
Tue 23 Oct 2012 04:24:44 PM UTC, comment #2:

That seems reasonable, although it might still be useful to have a built-in option for running commands under sudo. It seems like this would be a common use case for system admins.

Ben Booth <benwbooth>
Tue 23 Oct 2012 01:13:07 PM UTC, comment #1:

If --onall could be combined with --pipe then this should work:

echo password | parallel -S server1,server2 --onall --pipe sudo -S do_stuff

The idea here being that the stdin would be copied to all servers.

Would that be sufficient to you?

Maybe it is better to discuss this on the mailinglist: parallel@gnu.org.

Ole Tange <tange>
Project Administrator
Tue 23 Oct 2012 01:35:01 AM UTC, original submission:

It would be nice if GNU parallel could handle executing remote ssh commands with sudo. This would require GNU parallel to ask the user for the sudo password at the terminal before running the jobs, then send the password to the sudo command's stdin using the sudo -S option. There could also be a --user option which tells sudo to execute the command as a user besides root, using the sudo -u <user> option.

SSH power tool has this functionality: http://code.google.com/p/sshpt/, but it's not as powerful as GNU parallel. This option would make it much easier to execute remote administrative commands over ssh.

Thanks!

Ben Booth <benwbooth>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by tange (Posted a comment)
  • -unavailable- added by benwbooth (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 23 Oct 2012 01:13:38 PM UTCtangeSeverity3 - Normal=>1 - Wish

    Back to the top


    Powered by Savane 3.1-cleanup