重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 209|回复: 0
打印 上一主题 下一主题

[系统管理] Oracle Linux: Can't Connect via SSH with "Permission denied"

[复制链接]
跳转到指定楼层
楼主
发表于 5 天前 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
现象:
Not able to connect to a Linux system using a password-protected SSH Private Key from the Bastion system.

The Private Key's password is asked multiple times and eventually fails:

[opc@bastion ~]$ ssh -i ./.ssh/ssh_key opc@server
Enter passphrase for key './.ssh/ssh_key':
Enter passphrase for key './.ssh/ssh_key':
Enter passphrase for key './.ssh/ssh_key':
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
[opc@bastion ~]$
The original SSH Private Key (in PPK format) is working outside the Bastion system.

原因:
In the below excerpt from the "ssh -vvv -i ./.ssh/ssh_key opc@server" command, it can be seen that the SSH Client is replying with "bad passphrase given, try again...":

debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: ./.ssh/ssh_key
Enter passphrase for key './.ssh/ssh_key':
debug2: bad passphrase given, try again...
Enter passphrase for key './.ssh/ssh_key':
debug2: bad passphrase given, try again...
Enter passphrase for key './.ssh/ssh_key':
debug2: bad passphrase given, try again...
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

The above means that the SSH Client is unable to use the provided password to decrypt the password-protected Private Key.

处理方法:
The OpenSSH Private Key present in the Bastion system needs to be regenerated (as per Doc ID 2490591.1) and the resulting file uploaded to the Bastion system.

Do ensure that the uploaded SSH Private Key is only readable by the intended user (in the above example, the "opc" user).
This can be achieved via the "chmod -v go-rwx ./.ssh/ssh_key" command (where "./.ssh/ssh_key" corresponds to the uploaded SSH Private Key).

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2025-2-21 23:12 , Processed in 0.078612 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表