# Edit sudoers with visudo
# myuser ALL=(ALL) NOPASSWD: /mybin/killexe MYEXE
# myuser ALL=(ALL) NOPASSWD: /mybin/MYEXE
# myuser ALL=(ALL) NOPASSWD: /mybin/killexe MYEXE
# myuser ALL=(ALL) NOPASSWD: /mybin/MYEXE
use Net::Telnet ();
$t = new Net::Telnet (Timeout => 10,
Prompt => '/\[myuser\@myhost\ mydir\]\$ $/');
$t->open("127.0.0.1");
$t->login("user","password");
@lines = $t->cmd("who");
print @lines;
$t = new Net::Telnet (Timeout => 10,
Prompt => '/\[myuser\@myhost\ mydir\]\$ $/');
$t->open("127.0.0.1");
$t->login("user","password");
@lines = $t->cmd("who");
print @lines;
沒有留言:
張貼留言