创建密码保护的Samba存储池

2024-06-24 13:26:59 发布

您现在位置:Python中文网/ 问答频道 /正文

<pool type="netfs">
  <name>virtimages</name>
  <source>
    <host name="0.0.0.0"/>
    <dir path="/var/lib/virt/images"/>
    <format type='cifs'/>
  </source>
  <target>
    <path>/var/lib/virt/images</path>
  </target>
</pool>

上述libvirt XML配置可用于创建Samba存储池,但如何创建受密码保护的Samba存储池


Tags: pathnamehostsourcetargetvarlibtype
1条回答
网友
1楼 · 发布于 2024-06-24 13:26:59

您必须在源代码中添加一个auth部分,例如:

  <name>YourStorage</name>
  <source>
    <host name="storage.example.com" />
    <dir path="/backup" />
    <format type="cifs" />
    <auth type='chap' username='SomeSecretUsername'>
      <secret usage='SomeSecretPass'/>
    </auth>
  </source>
  <target>
    <path>/mnt/storage</path>
  </target>
</pool>```

See: https://libvirt.org/formatstorage.html#StoragePoolSource

相关问题 更多 >