Hallo, ich habe versucht mittels SSHKeys, meine Verbindung von PHP zu Linux Server sicherer zu machen, aber die Verbindung scheitert.
PHP
<?php
$methods = array(
'kex' => 'diffie-hellman-group1-sha1',
'hostkey' => 'ssh-rsa',
'client_to_server' => array(
'crypt' => '3des-cbc',
'mac' => 'hmac-md5',
'comp' => 'none'),
'server_to_client' => array(
'crypt' => '3des-cbc',
'mac' => 'hmac-md5',
'comp' => 'none'));
$connection = ssh2_connect('127.0.0.1', 22, $methods);
if (ssh2_auth_pubkey_file($connection, 'root',
'/root/id_rsa.pub',
'/root/id_rsa', 'rootpw')) {
echo "Public Key Authentication Successful\n";
} else {
die('Public Key Authentication Failed');
}
?>
Alles anzeigen
mfg