Linux设置共享文件夹

谁践踏了优雅 2021-09-23 14:22 475阅读 0赞

首先执行命令安装 samba

  1. yum -y install samba samba-client samba-common

执行命令修改配置文件

  1. sudo vi /etc/samba/smb.conf

上述文件修改为

  1. # See smb.conf.example for a more detailed config file or
  2. # read the smb.conf manpage.
  3. # Run 'testparm' to verify the config is correct after
  4. # you modified it.
  5. [global]
  6. workgroup = SAMBA
  7. map to guest = bad user
  8. #Arcvideo Live setting start
  9. #security = share
  10. username map = /etc/samba/smbusers
  11. encrypt passwords = true
  12. passdb backend = smbpasswd
  13. smb passwd file =/etc/samba/smbpasswd
  14. #Arcvideo Live setting end
  15. #Arcvideo Live Setting modify# security = user
  16. #Arcvideo Live Setting modify# passdb backend = tdbsam
  17. printing = cups
  18. printcap name = cups
  19. load printers = yes
  20. cups options = raw
  21. [homes]
  22. comment = Home Directories
  23. valid users = %S, %D%w%S
  24. browseable = No
  25. read only = No
  26. inherit acls = Yes
  27. [printers]
  28. comment = All Printers
  29. path = /var/tmp
  30. printable = Yes
  31. create mask = 0600
  32. browseable = No
  33. [print$]
  34. comment = Printer Drivers
  35. path = /var/lib/samba/drivers
  36. write list = root
  37. create mask = 0664
  38. directory mask = 0775
  39. [share]
  40. comment = share
  41. path = /data/share
  42. available = Yes
  43. browseable = Yes
  44. public = Yes
  45. writable = Yes
  46. printable = No

执行命令重启服务即可

  1. systemctl restart smb.service

输入共享文件夹地址即可访问(我这里直接输入的linux的IP地址)

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM1NTczMzI2_size_16_color_FFFFFF_t_70

发表评论

表情:
评论列表 (有 0 条评论,475人围观)

还没有评论,来说两句吧...

相关阅读

    相关 VMware设置共享文件夹

    查资料说虚拟机安装VMware Tools之后可以进行复制粘贴。但我试了安装或者重装VMware Tools都没有用。找到一种新的解决方法。 设置共享文件夹 ![3bd