Enter LAN Password: Enter LAN Password: * Stopping NTP server ntpd ...done. * Stopping NTP server ntpd ...done. Enter LAN Password: Enter LAN Password: Enter LAN Password: * Starting NTP server ntpd ...done. ntpd: time slew +0.001779s Enter LAN Password: * Starting NTP server ntpd ...done. #### sub sudo_install { my ($label, $ssh, @pkgs) = @_; my ($pty) = $ssh->open2pty('sudo', 'apt-get', 'install', @pkgs); my $expect = Expect->init($pty); $expect->raw_pty(1); $expect->expect($timeout, ":"); $expect->send("$passwd\n"); $expect->expect($timeout, "\n"); $expect->raw_pty(0); while(<$expect>) { print }; close $expect; } $pssh->push('*', parsub => \&sudo_install, 'scummvm');