[tpm] Terminating SSH sessions

arocker at vex.net arocker at vex.net
Fri Aug 7 14:03:22 PDT 2009

What is the proper command to drop an SSH connection? The documentation is
rather vague on the subject.

I have a connection established with (essentially):

$ssh = Net::SSH:Perl->new('remote.machine_id', protocol => '2' &c);

Trying to hang up with:

($stdout, $stderr, $rc) = $ssh->cmd("disconnect");

produces a return code of 127, and an "disconnect: command not found"
error message from bash in $stderr

Changing "disconnect" to "exit" produces a nice clean hang up.

More information about the toronto-pm mailing list