Net::Scan::SSH::Server::SupportedAuth - detect supported authentication method of SSH server
use Net::Scan::SSH::Server::SupportedAuth qw(:flag); my $scanner = Net::Scan::SSH::Server::SupportedAuth->new(host => 'localhost'); ### get result as hash my $sa_hash = $scanner->scan_as_hash; # $sa_hash = {'1' => {'password' => 0,'publickey' => 0}, # '2' => {'password' => 0,'publickey' => 1}}; ### get result as bit flag my $sa = $scanner->scan; sub checker { my($label, $boolean) = @_; printf "%-26s: %s\n", $label, $boolean ? 't' : 'f'; } checker("2-publickey only", ($sa->{2} == $AUTH_IF{publickey} && $sa->{1} == 0) ); checker("any-publickey", (($sa->{1} | $sa->{2}) & $AUTH_IF{publickey}) ); checker("2-publickey or 2-password", ($sa->{2} & ( $AUTH_IF{publickey} | $AUTH_IF{password} )) );
Net::Scan::SSH::Server::SupportedAuth connect SSH server and probe protocol version and supported authentication method (publickey or password).
$scanner = Net::Scan::SSH::Server::SupportedAuth->new( %option )
This method constructs a new "Net::Scan::SSH::Server::SupportedAuth" instance and returns it. %option is to specify SSH server.
key value ======================================================== host "hostname" or "IP address" (default: '127.0.0.1') port "port number" (default: '22')
$sa = $scanner->scan;
Do scan and return hash reference which contains information of supported authentication method.
$sa = { VERSION => AUTH_FLAGS, VERSION => AUTH_FLAGS, ... } VERSION : SSH protocol version. 1 or 2. AUTH_FLAGS : 32bit bit flags. to compare with %Net::Scan::SSH::Server::SupportedAuth::AUTH_IF.
$sa_hash = $scanner->scan_as_hash;
Do scan and return human readable hash reference which contains information of supported authentication method.
$sa_hash = { VERSION => { password => 0 or 1, publickey => 0 or 1, }, VERSION => { password => 0 or 1, publickey => 0 or 1, }, ... } VERSION : SSH protocol version. 1 or 2.
$string = $scanner->dump;
Do scan and return as string.
Net::SSH::Perl http://www.openssh.com/
HIROSE Masaaki, <hirose31@gmail.com>
<hirose31@gmail.com>
Please report any bugs or feature requests to bug-net-scan-ssh-server-supportedauth@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-net-scan-ssh-server-supportedauth@rt.cpan.org
Copyright 2007 HIROSE Masaaki, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::Scan::SSH::Server::SupportedAuth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Scan::SSH::Server::SupportedAuth
CPAN shell
perl -MCPAN -e shell install Net::Scan::SSH::Server::SupportedAuth
For more information on module installation, please visit the detailed CPAN module installation guide.