]> xenbits.xensource.com Git - libvirt.git/commitdiff
schema: add ssh-agent configuration for ssh disks
authorJonathon Jongsma <jjongsma@redhat.com>
Fri, 14 Jul 2023 20:14:25 +0000 (15:14 -0500)
committerJonathon Jongsma <jjongsma@redhat.com>
Tue, 19 Sep 2023 19:28:50 +0000 (14:28 -0500)
Add the ability to specify a path to a ssh-agent socket in order to use
the ssh-agent to authenticate to remote ssh disks. Example
configuration:

    <disk type='network'>
        </source protocol='ssh' ...>
            <identity username='myusername' agentsock='/path/to/socket'/>
            ...
        </source>
        ...
    </disk>

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
docs/formatdomain.rst
src/conf/schemas/domaincommon.rng

index 74c714fef0812243b49a510d2f0968e64c4e4d9c..4a1b6faee49343ff88e7b0d06b6f10ca8f35d720 100644 (file)
@@ -3022,11 +3022,14 @@ paravirtualized driver is specified via the ``disk`` element.
       are intended to be default, then the entire element may be omitted.
 
       When using an ``ssh`` protocol, this element is used to enable
-      authentication via ssh keys. In this configuration, the element has two
-      attributes. The ``username`` attribute specifies the name of the user on
-      the remote server and the ``keyfile`` attribute specifies the path to the
-      keyfile. Note that this only works for ssh keys that are not
-      password-protected.
+      authentication via ssh keys. In this configuration, the element has three
+      possible attributes. The ``username`` attribute is required and specifies
+      the name of the user on the remote server. ssh keys can be specified in
+      one of two ways. The first way is by adding them to an ssh-agent and
+      providing the path to the ssh-agent socket in the ``agentsock``
+      attribute. This method works for ssh keys with or without password
+      protection. Alternatively, for ssh keys without a password, the ssh key
+      can be specified directly by setting the ``keyfile`` attribute.
    ``reconnect``
       For disk type ``vhostuser`` configures reconnect timeout if the connection
       is lost. This is set with the two mandatory attributes ``enabled`` and
index 1a99a0c4e384ff57f9f5d0d5801216c58b559794..a26986b5ce7f723c09cf221602795a770db01f9f 100644 (file)
         <attribute name="username">
           <ref name="genericName"/>
         </attribute>
-        <attribute name="keyfile">
-          <ref name="absFilePath"/>
-        </attribute>
+        <choice>
+          <attribute name="keyfile">
+            <ref name="absFilePath"/>
+          </attribute>
+          <attribute name="agentsock">
+            <ref name="absFilePath"/>
+          </attribute>
+        </choice>
       </interleave>
     </element>
   </define>