SSH permissions error when resizing or migrating an instance (OpenStack)
If you are resizing or migrating an instance KVM, KVM for IBM z Systems®, or PowerKVM hypervisors, you might encounter an ssh ...Permission denied error.
In this situation, you must ensure that the hypervisors
can ssh (as a Nova user) to each
other by public key. To do so, complete the following steps:
- Obtain a key pair (public key and private key). You can use the root key that is in the `/root/.ssh/id_rsa and /root/.ssh/id_ras.pub directories or you can generate a new key pair.
- Run setenforce 0 to put SELinux into permissive mode.
- Enable login abilities for the Nova user.
Now you can switch to the Nova account by using the following command.usermod -s /bin/bash novasu nova - Create the folder that is needed by ssh and
place the private key that you obtained in step 1 into this folder.
mkdir -p /var/lib/nova/.ssh cp <private key> /var/lib/nova/.ssh/id_rsa cat<pub key> >> /var/lib/nova/.ssh/authorized_keys echo 'StrictHostKeyChecking no' >> /var/lib/nova/.ssh/config chmod 600 /var/lib/nova/.ssh/id_rsa /var/lib/nova/.ssh/authorized_keys - Repeat steps 2-4 on each node.Important: All the nodes share a key pair and you must not generate a new key pair for the second node.
- Ensure that the key is working properly.
# su - nova # ssh node-anotherNote:- You log in to the node-another node without a password.
- If your server is configured with both the IP address and the
hostname, you must run this command twice. For example:
- su nova ssh nova@host-name
- su nova ssh nova@x.x.x.x
where x.x.x.x is the server IP address.