Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Perl script to run sudo command(s) on multiple boxes without the use of expect module.

by i5513 (Pilgrim)
on Aug 05, 2015 at 11:03 UTC ( [id://1137492]=note: print w/replies, xml ) Need Help??


in reply to Perl script to run sudo command(s) on multiple boxes without the use of expect module.

Hello durgesh_p,

Why do you not want to use expect?

Do you have public key infraestructure handling ssh access to your account?

Not perl related, but you could consider see ansible

PD: I have a perl script to use 'ssh server "su - -c xxx"' , but it is using expect, it is called as_root
PD2: To run it on several machines I would use pdsh (still on code.google.com :( )
  • Comment on Re: Perl script to run sudo command(s) on multiple boxes without the use of expect module.

Replies are listed 'Best First'.
Re^2: Perl script to run sudo command(s) on multiple boxes without the use of expect module.
by durgesh_p (Initiate) on Aug 05, 2015 at 17:43 UTC
    There are risks associated with " Expect " with handing passwords... Ansible is an option , but looking for a simple script based solution...

      All scripts which have a password inside will have the same problems that using Expect to introduce password, isn't it?.

      I think it is better to use pki and passwordless specifics sudo commands

      Regards

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1137492]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2024-04-23 16:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found