From: ganesh kg Subject: access remote xen server using sudo user Date: Mon, 28 Nov 2016 12:42:40 +0000 (UTC) Message-ID: <612807387.2112044.1480336960200@mail.yahoo.com> References: <612807387.2112044.1480336960200.ref@mail.yahoo.com> Reply-To: ganesh kg Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8736564774016596449==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============8736564774016596449== Content-Type: multipart/alternative; boundary="----=_Part_2112043_770637483.1480336960198" Content-Length: 3310 ------=_Part_2112043_770637483.1480336960198 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable HI, i am trying to use sudo user to access xen server remotely. As its docu= mented, libvirtd can be accessed only through root user or users from libvi= rtd usergroup. is there any tweak or possibility to access libvirt remotely through sudo u= ser? or by using certificate? code snippet: #!/usr/bin/env python import sys import libvirt conn =3D libvirt.open('xen+ssh://sudo_user@xen_server')=C2=A0 <=3D=3D Tryin= g to establish connection to the remote xen using sudo user. if conn =3D=3D None: =C2=A0=C2=A0=C2=A0 print('Failed to open connection to xen+ssh:xen_server') =C2=A0=C2=A0=C2=A0 exit(1) host =3D conn.getHostname() print('Hostname:'+host) conn.close() exit(0) ------=_Part_2112043_770637483.1480336960198 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
HI, i am trying to use = sudo user to access xen server remotely. As its documented, libvirtd can be= accessed only through root user or users from libvirtd usergroup.

is there any tweak or possibility to acce= ss libvirt remotely through sudo user? or by using certificate?

code snippet:

=

#!/usr/bin/env python

import sys
import libvirt

conn =3D libvirt.open('xen+ssh://sudo_user@xen_server')  <= =3D=3D Trying to establish connection to the remote xen using sudo user.if conn =3D=3D None:
    print('Failed to open conn= ection to xen+ssh:xen_server')
&= nbsp;   exit(1)

host =3D conn.getHostname()
print('Hostname:'+host)

conn.= close()
exit(0)




------=_Part_2112043_770637483.1480336960198-- --===============8736564774016596449== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============8736564774016596449==--