1. kvm server添加webvirtmgr用户
useradd webvirtmgr
passwd webvirtmgr
groupadd libvirt
usermod -aG libvirt webvirtmgr
2. webvirtmgr server配置ssh免密认证
su - nginx -s /bin/bash
touch ~/.ssh/config && echo -e “StrictHostKeyChecking=no\nUserKnownHostsFile=/dev/null” >> ~/.ssh/config
chmod 0600 ~/.ssh/config
ssh-keygen -t rsa 一路按回车确认
ssh-copy-id webvirtmgr@kvmserver_IP
3. kvm server添加ssh授权
vim /etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
[Remote libvirt SSH access]
Identity=unix-user:webvirtmgr
Action=org.libvirt.unix.manage
ResultAny=yes
ResultInactive=yes
ResultActive=yes
chown -R webvirtmgr.webvirtmgr /etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
systemctl rest