weezul
22nd December 2008, 21:04
Hello, i want to connect to another host using:
<?php
$connection = ssh2_connect('shell.example.com', 22, array('hostkey'=>'ssh-rsa'));
if (ssh2_auth_pubkey_file($connection, 'username',
'/home/username/.ssh/id_rsa.pub',
'/home/username/.ssh/id_rsa', 'secret')) {
echo "Public Key Authentication Successful\n";
} else {
die('Public Key Authentication Failed');
}
?>
this connection function.
so i created a keypair on the host i want to connect to and moved both keys to the other host the webserver runs on.
my problem is this function always returns false :/
so for debug reasons, where can i make the sshdemon log every connection attempt?
auth.log seems to log only authentication attempts but no connection attempts.
<?php
$connection = ssh2_connect('shell.example.com', 22, array('hostkey'=>'ssh-rsa'));
if (ssh2_auth_pubkey_file($connection, 'username',
'/home/username/.ssh/id_rsa.pub',
'/home/username/.ssh/id_rsa', 'secret')) {
echo "Public Key Authentication Successful\n";
} else {
die('Public Key Authentication Failed');
}
?>
this connection function.
so i created a keypair on the host i want to connect to and moved both keys to the other host the webserver runs on.
my problem is this function always returns false :/
so for debug reasons, where can i make the sshdemon log every connection attempt?
auth.log seems to log only authentication attempts but no connection attempts.