Environment: CentOS 7.4
1. Create SSH private key and SSH configuration options (on systems with Webvirtmgr installed):
# Switch to Nginx user
Su-nginx-s/bin/bash
# production ssh key Ssh-keygen
#(path-to-id-rsa-in-nginx-home): ...
# Configure Permissions Touch ~echo -E "stricthostkeychecking=no\nuserknownhostsfile=/dev/null" >> ~/.ssh/ 0600 ~/.ssh/config
2. Add the Webvirt user (on the Qemu-kvm/libvirt host server) and add it to the correct group:
Groupadd libvirtdadduser webvirtmgrpasswd webvirtmgrusermod-g libvirtd-a webvirtmgrusermod-g libvirtd-a Root
3. Return the Webvirtmgr host and copy the public key to the Qemu-kvm/libvirt host server (on the system where Webvirtmgr is installed):
Su-nginx-s/bin/bashsh-copy-id [email protected]-P port
# Password entry will appear here
# After successful use this command test, if you can quickly log in then the new success
SSH [email protected]-P port
4. Set permissions to manage Libvirt (on Qemu-kvm/libvirt host server):
vi/etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access. pkla # (remote user rights webvirtmgr) [Remotes Libvirt SSH access]identity =unix-user:webvirtmgr Action =org.libvirt.unix. manageresultany =yesresultactive =yes
Vi/etc/polkit-1/localauthority/50-local.d/50-org.libvirtd-group-access. Pkla# (local user group LIBVRITD permissions) [LIBVIRTD group Management access]identity=unix-group: LIBVIRTD Action=org.libvirt.unix. manageresultany=yesresultinactive=yesresultactive=yes
5. Set up user groups to start the LIBVIRTD service
Vi/etc/libvirt/libvirtd.conf
6. Add SSH login configuration in Webvirtmgr
Reference:
Https://github.com/retspen/webvirtmgr/wiki/Setup-SSH-Authorization
CentOS 7 Build KVM online admin panel webvirtmgr login with SSH authorization