Функция PHP пытается подключиться к IP-адресу, используя файл ключа SSH: -
Код: Выделить всё
function minnerConnect($miner_serial) {
$port = '7822';
$miner_ip = $this->getMinerIp($miner_serial);
$methods = array(
'kex' => 'diffie-hellman-group1-sha1',
'hostkey' => 'ssh-dss',
'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($miner_ip, $port, $methods);
if (ssh2_auth_pubkey_file($connection, 'root',
'/root/.ssh/id_dsa.pub',
'/root/.ssh/id_dsa','')) {
echo "Public Key Authentication Successful\n";
} else {
echo "Public Key Authentication Failed";
}
( ! ) Предупреждение: ssh2_auth_pubkey_file (): Аутентификация root с использованием открытого ключа не удалась: обратный вызов возвратил ошибку в /var/www/application/models/miner_model.php в строке 95
строка 95 – '/root/.ssh/id_dsa','')) {.
Может ли кто-нибудь предложить исправление?
Подробнее здесь: https://stackoverflow.com/questions/238 ... ways-fails