# Starting ssh without password # 1) run the constructor my $ssh = Net::SSH::Expect->new ( host => "myserver.com", user => 'bnegrao', raw_pty => 1 ); # 2) now start the ssh process $ssh->run_ssh() or die "SSH process couldn't start: $!"; # 3) you should be logged on now. Test if remote prompt is received: ($ssh->read_all(2) =~ />\s*\z/) or die "where's the remote prompt?" $ssh->exec("whoami"); $ssh->exec("/sbin/ifconfig"); $ssh->exec("ls /"); ssh->close();