Virtual-Machine

Samba:如何只允許 QEMU 來賓訪問共享文件夾,而不允許其他使用者訪問?

  • January 19, 2018

QEMU/KVM用於各種來賓系統的虛擬化,並Samba在主機作業系統和來賓作業系統之間提供交換文件夾(共享文件夾)。

現在我想保護這個提供的Samba共享文件夾免受外部訪問。它應該只能由QEMU-virtualized guest 訪問,而不是同一網路中的其他第三方人員訪問。


我目前的配置/etc/samba/smb.conf如下所示:

[global]
workgroup = WORKGROUP
security = user
map to guest = Bad User
server string = %h server (Samba, Ubuntu)
dns proxy = No
wins support = Yes
usershare allow guests = Yes
panic action = /usr/share/samba/panic-action %d
lanman auth = no
ntlm auth = no
follow symlinks = yes
wide links = yes
load printers = no
disable spoolss = yes

[Shared]
comment = Shared Folder for QEMU
path = /home/myusername/Exchange
public = no
browseable = yes
writeable = yes
read only = no
guest ok = yes
force user = myusername

現在核心問題是:

您對我如何實施這樣的安全強化功能有什麼建議嗎?

非常感謝你!

將您的 samba 綁定到來賓 VM 和主機之間的虛擬介面。編輯 smb.conf 並添加以下行

bind interfaces only = yes
interfaces = lo br0

引用自:https://unix.stackexchange.com/questions/418154