I'm using this Dockerfile to build my image:
https://github.com/retspen/webvirtcloud/blob/master/Dockerfile
But as the default user of the container is root I'm having some problems with SSH. The key generated is for the user www-data and not for root when I try to connect with the command ssh root@compute1 the password is requested.
Documentation settings:
chown www-data -R ~www-data
sudo -u www-data ssh-keygen
cat > ~www-data/.ssh/config << EOF
Host *
StrictHostKeyChecking no
EOF
chown www-data -R ~www-data/.ssh/config
To try to get around the problem, I generated the keys for root with the commands below:
ssh-keygen
cat > ~root/.ssh/config << EOF
Host *
StrictHostKeyChecking no
EOF
ssh-copy-id root@compute1
ssh root@compute1
This way the password was no longer requested.
Is there a better way to do these settings?
Note: "passphrase" was not defined when generating the keys. The password requested is the KVM host password.
I'm using this Dockerfile to build my image:
https://github.com/retspen/webvirtcloud/blob/master/Dockerfile
But as the default user of the container is root I'm having some problems with SSH. The key generated is for the user www-data and not for root when I try to connect with the command
ssh root@compute1the password is requested.Documentation settings:
chown www-data -R ~www-datasudo -u www-data ssh-keygenchown www-data -R ~www-data/.ssh/configTo try to get around the problem, I generated the keys for root with the commands below:
ssh-keygenssh-copy-id root@compute1ssh root@compute1This way the password was no longer requested.
Is there a better way to do these settings?
Note: "passphrase" was not defined when generating the keys. The password requested is the KVM host password.