Net:: Telnet and sudo problem
- I've posted this before a after several suggestion offline it was
suggested to repost to all.
I'm using Net::telnet to log into a remote server and once there I issue
the following commands.
my @answer = $TELNET->print('sudo df -k');
print "TEST @answer\n";
If I do this without sudo it works fine, but the shell script I want to
run requires root access this the need for sudo.
The dump_log puts this out!
0x00000: 73 75 64 6f 20 64 66 20 2d 6b 0d 0a sudo df
< 0x00000: 73 75 64 6f 20 64 66 20 2d 6b 0d 0a sudo df
< 0x00000: 50 61 73 73 77 6f 72 64 3a Password:
> 0x00000: 71 7a 67 71 32 32 31 37 0d 0a <mypasswd>..
The only thing I get back in @answer is a 1, not the output from df -k.
I believe the "1" coming back is from the successful password entry.
How can I get the results back from the df or any other command/script I
want through sudo?
HP UNIX OVO Enrollment