ssh2_auth_pubkey_file()的身份验证错误

我在php中使用 ssh2_auth_pubkey_file()</ code>函数遇到了问题。 我阅读了php手册,我对它的参数感到困惑。</ p>

ssh2_auth_pubkey_file()</ code>有4个参数,即 ssh2_connection </ code>,< code> user_name </ code>, public_key </ code>, private_key </ code>, passphrase </ code>。</ p>

我有一个“ 使用公钥操作身份验证失败:无法打开公钥文件</ strong>“错误。</ p>

我在客户端服务器上使用oper生成了公钥和私钥, 然后将公钥发送到远程服务器。 此密钥存储为 home / oper / .ssh / autorized_keys </ code>。</ p>

我对 ssh2_auth_pubkey_file()</ code>函数的参数 public_key </ code>,这个 public_key </ code>是指本地 public_key </ code>还是远程 public_key </ code>? 我想知道私钥是一样的。</ p>

这可能是一个许可问题,但我无法弄明白。</ p>
</ div>

展开原文

原文

I faced a problem with using the ssh2_auth_pubkey_file() function in php. I read the php manual and I am confused about its parameters.

ssh2_auth_pubkey_file() has 4 parameters, which is ssh2_connection, user_name, public_key, private_key, passphrase.

I got a "Authentication failed for oper using public key: Unable to open public key file" error.

I generated a public key and a private key with oper at client server, then sent the public key to the remote server. This key is stored as home/oper/.ssh/autorized_keys.

I am confused the ssh2_auth_pubkey_file() function's parameter public_key, is this public_key means local public_key or remote public_key? I am wondering the same for the private key.

It is probably a permission issue, but I just can't figure it out.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问