<div dir="ltr">Martin,<div><br><div>What do you mean by libvirt credentials...?</div><div><br></div><div><br></div><div><br></div><div>-Sijo</div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, Jun 6, 2014 at 1:57 PM, Martin Kletzander <span dir="ltr"><<a href="mailto:mkletzan@redhat.com" target="_blank">mkletzan@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On Fri, Jun 06, 2014 at 01:06:55PM +0530, Sijo Jose wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
Hi,<br>
I am using libvirt with python binding, and I want to connect to a remote<br>
host.<br>
I was able to connect after making ssh certificate, but It is not<br>
applicable for my project.<br>
So I want to use openAuth() method, but I could not succeed connecting to a<br>
remote host using it.<br>
<br>
Here is my code<br>
------------------------<br>
<br>
import libvirt<br>
<br>
<br>
USER = "root"<br>
PASS = "mypasswd"<br>
<br>
def authcb(credentials, user_data):<br>
   for credential in credentials:<br>
       if credential[0] == libvirt.VIR_CRED_AUTHNAME:<br>
           credential[4] = USER<br>
       elif credential[0] == libvirt.VIR_CRED_PASSPHRASE:<br>
           credential[4] = PASS<br>
   return 0<br>
<br>
auth = [[libvirt.VIR_CRED_AUTHNAME, libvirt.VIR_CRED_PASSPHRASE], authcb, None]<br>
conn = libvirt.openAuth("qemu+ssh://<a href="http://192.168.1.21/system" target="_blank">1<u></u>92.168.1.21/system</a>", auth, 0)<br>
<br>
print conn.getHostname()<br>
------------------------------<u></u>-<br></div>
*If there is something wrong, how am I supposed to use it.*<div class=""><br>
<br>
If its not the right place to get libvirt-python related help, from<br>
where can I get it.<br>
<br>
</div></blockquote>
<br>
What's the error you see?  Those root:mypasswd are credentials for<br>
libvirt and *not* ssh, beware of that.<br>
<br>
Martin<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Regards<br>
Sijo<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
______________________________<u></u>_________________<br>
libvirt-users mailing list<br>
<a href="mailto:libvirt-users@redhat.com" target="_blank">libvirt-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libvirt-users" target="_blank">https://www.redhat.com/<u></u>mailman/listinfo/libvirt-users</a><br>
</blockquote>
</blockquote></div><br></div>