Recently I have had some issues with connecting from my laptop running Linux OS (Fedora 30, Xubuntu 19.04) from virt-manager to server running KVM. Virt-Manager keeps asking me for root password, which was very annoying.
The solution was simple – first I had to create ssh keys which then I needed to send to my CentOS(7) server running KVM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/username/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/username/.ssh/id_rsa. Your public key has been saved in /home/username/.ssh/id_rsa.pub. The key fingerprint is: SHA256:1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567 username@laptop The key's randomart image is: +---[RSA 2048]----+ | xxxxxxxxxxxx| | xxxxxxxxxx | | x x x x x x | | xxxxxxxxxx | | x x x x x | | xx xx xx x | | x x x x x x | | xxx x x x x | | xxxxxxxxxxxx | +----[SHA256]-----+ # ssh-copy-id root@192.168.200.50 /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys root@192.168.200.50's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'root@192.168.200.50'" and check to make sure that only the key(s) you wanted were added. |
After that I was able to use Virt-Manager without any asking for password.