4、编辑Samba配置文件
root@Ubuntu1:~# vim /etc/samba/smb.conf
[USB1]
comment = USB1
path = /media/usb1   #第一个USB挂载路径,对应前面定义的udev规则
browseable = yes    #浏览权限
guest ok = yes     #匿名共享
writeable = yes    #是否可写
[USB2]
comment = USB2
path = /media/usb2
browseable = yes
guest ok = yes
writeable = yes
[USB3]
comment = USB3
path = /media/usb3
browseable = yes
guest ok = yes
writeable = yes
[USB4]
comment = USB4
path = /media/usb4
browseable = yes
guest ok = yes
writeable = yes
[USB5]
comment = USB5
path = /media/usb5
browseable = yes
guest ok = yes
writeable = yes
  5、重新加载配置文件
  root@Ubuntu1:/etc/samba# /etc/init.d/smbd reload
  四、测试
  √  U盘1:金士顿 2G、FAT32
  √  U盘2:SanDisk 8G、FAT32
  √  U盘3:SanDisk 8G、NTFS
  √  U盘4:读卡器 8G、exFAT
  √  移动硬盘:ZALMAN 60G、NTFS
  效果如下:

  五、现存问题
  ● 只共享5个USB设备,USB1~5,拔出后设备还存在
  ● 共享内容只有读权限,不可写入
  ● udev规则有时不生效,USB设备拔出后设备不卸载,占用设备号。如插入sdb1,拔出后sdb1依旧存在,再次插入变为了sdc1,可用数量会减少
  (可写Shell脚本自动卸载解决)