[libvirt-users] How can I open a libvirt remote connection with ssh
Wangkai (Kevin,C)
wangkai86 at huawei.com
Thu Apr 11 09:45:18 UTC 2013
Hi,
When I use 'virConnectOpenAuth' function to connect to '192.168.1.102' libvirtd with ssh,
Code below, the screen print the dialog "root at 192.168.1.102's password:" , and only
After I type the password, the connection can be created.
How can I connect to libvirtd with ssh automatically? No need to type the password manually.
char *au[2] = {"root", "xxxx"};
virConnectAuth auth = {
credTypes,
sizeof(credTypes) / sizeof(int),
virConnCb,/* callback function, actually was not be called after connect*/
au /* user and password */
};
conn = virConnectOpenAuth("qemu+ssh://192.168.1.102/system", &auth, 0);
Thanks,
Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20130411/10a9246b/attachment.htm>
More information about the libvirt-users
mailing list