lemonlatte / docker-webvirtmgr

Dockerfile for Webvirtmgr
MIT License
6 stars 6 forks source link

SSH-Keys & User #1

Open ITFactoryAUT opened 9 years ago

ITFactoryAUT commented 9 years ago

Hello, first of all thank you very much for your dockerscript! Did you thought about ssh-keys authorization and a changeable user/password combination for the webinterface?

My aproach of the ssh-key would be to create them and link them in the bootstrap.sh with:

if [! -f "/var/local/webvirtmgr/.ssh/id_rsa"] && [! -f "/var/local/webvirtmgr/.ssh/id_rsa.pub"]  && [! -f "/var/local/webvirtmgr/.ssh/config"]; then
su - www-data -s /bin/bash
mkdir /var/local/webvirtmgr/.ssh
ssh-keygen -f /var/local/webvirtmgr/.ssh/
touch /var/local/webvirtmgr/config && echo -e "StrictHostKeyChecking=no\nUserKnownHostsFile=/dev/null" >> /var/local/webvirtmgr/.ssh/config
chmod 0600 ~/.ssh/config

fi

ln -s  /var/local/webvirtmgr/.ssh ~/
exit

So on the host system you have the private/public key kombination available to copy the id to the appropriate libvirt host. What do you think of this approach?

Do you have an idea for the second question (changeable user/pass)?

Thx and greetings Nico

Priyanka12345678910 commented 6 years ago

Cannot recv data: Host key verification failed.: Connection reset by peer

I get above error while selecting on any host, even if it is active. Is this issue related to the same ? Can someone please provide the solution of it ?

chemax commented 5 years ago

docker exec 7739029b0cdd sed -i 's/\# StrictHostKeyChecking ask/StrictHostKeyChecking no/' /etc/ssh/ssh_config sorry for necroposting