non - interactive su via batch

February 1, 2010 at 11:16:15
Specs: Windows XP
hi
i am trying to run a batch file on a xp machine that uses plink to run commands on many (6000+) unix boxes.
i want to use the su command so as i can kill processes on the box, but i want the batch file to pass the password to su.
I cant go round and edit the sudo files on every box, is there a solution?

See More: non - interactive su via batch

Report •

#1
February 1, 2010 at 16:18:58
i guess thats a no...

Report •

#2
February 5, 2010 at 01:49:45
Well, if you're so inclined, you could write a script using the perl expect module to batch the SSH sessions.

http://search.cpan.org/~bnegrao/Net...

Something like:

$ssh->send('su');
$ssh->waitfor('password:\s*\z', 1)
$ssh->send("current_password");

(copied from the example)

And I think, the first thing you should do w/ this, is install sudo & enable public key authentication.


Report •
Related Solutions


Ask Question