qemu+ssh仅在sshd_config开启PasswordAuthentication时可用的问题求助
问题:virsh qemu+ssh公私钥连接失败(直接SSH连接正常)
我可以通过以下命令使用公私钥从笔记本电脑SSH连接到服务器:
$ ssh -i ~/.ssh/ed25519 chris@192.168.1.10 -p 22XX
我的公钥已正确放置在服务器的~/.ssh/authorized_keys文件中。
但尝试使用virsh通过qemu+ssh连接时失败,执行命令:
$ virsh -c qemu+ssh://chris@192.168.1.10:22XX/system
得到报错:
error: failed to connect to the hypervisor error: Cannot recv data: chris@192.168.1.10: Permission denied (publickey).: Connection reset by peer
将服务器sshd_config中的PasswordAuthentication设置为yes后,virsh命令可以成功连接,但我不希望开启SSH密码认证功能。
以下是笔记本电脑尝试无密码连接时的journalctl日志(截取最后100行):
$ journalctl --lines=100
Jan 25 18:06:05 arch polkitd[462]: Registered Authentication Agent for unix-process:1237:24897 (system bus name :1.52 [/usr/bin/pkttyagent --process 1237 --notify-fd 4 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) Jan 25 18:06:05 arch polkitd[462]: Unregistered Authentication Agent for unix-process:1237:24897 (system bus name :1.52, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
已做的配置排查:
- 笔记本和服务器均未运行
polkit.service - 服务器
libvirtd_config已设置auth_rw="none"和auth_ro="none" - 已安装
qemu-ssh-block-agent包
恳请协助解决此问题。
内容的提问来源于stack exchange,提问作者chuckd833
相关产品推荐
相关产品推荐

