Syntactic Confectionery Delight | |
PerlMonks |
Using Expect module in Net::Telnetby msk_0984 (Friar) |
on Jun 27, 2008 at 17:42 UTC ( [id://694402]=perlquestion: print w/replies, xml ) | Need Help?? |
msk_0984 has asked for the wisdom of the Perl Monks concerning the following question:
Respected Monks,
I have a task in which we need to connect to remote system using a normal user and then switch to a different priviledged user to execute some priviledge commands. I am using Net::Telnet module to connect to remote systems and then have to use "su" to switch to the other user using Expect module. But I am able to connect to the system using the normal user but as when we enter the command on the general terminal It prompts for a password for that trying to use Expect module but I am unable to do it. I think am doing wrong here Here is a small script that I am trying to use I am unable to find any examples to do that and searched a lot but could not find any. Please guide me so that I can switch to the other user and use that telnet channel to execute priviledged commands and get the output. Thanks In Advance
Sushil Kumar
Back to
Seekers of Perl Wisdom
|
|