개요
- PHP ssh2_auth_pubkey_file()
- 공개키를 이용하여 SSH 인증하는 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');
}
같이 보기
- PHP Warning: ssh2_auth_pubkey_file(): Authentication failed for
- 리눅스 ssh-copy-id
- PHP ssh2_connect()
- PHP SSH2 함수