samba安装

参考

https://www.insidentally.com/articles/000005/

安装samba

yum install samba

添加一账号给samba使用

useradd samba
passwd samba

配置samba使用的单独密码管理

smbpasswd -a samba
#修改密码
smbpasswd samba_user

修改配置文件后重启即可

配置文件路径

/etc/samba/smb.conf

[global]
        workgroup = SAMBA
        security = user

        passdb backend = tdbsam

        printing = cups
        printcap name = cups
        load printers = yes
        cups options = raw

[homes]
        comment = Home Directories
        valid users = %S, %D%w%S
        browseable = No
        read only = No
        inherit acls = Yes

[printers]
        comment = All Printers
        path = /var/tmp
        printable = Yes
        create mask = 0600
        browseable = No

[print$]
        comment = Printer Drivers
        path = /var/lib/samba/drivers
        write list = @printadmin root
        force group = @printadmin
        create mask = 0664
        directory mask = 0775
[myshare]
   comment = myshare
   # 共享文件夹路径
   path = /opt
   # 用户名
   valid users = samba
   # 是否公开
   public = no
   # 是否可写入
   writable = yes
   create mask = 0765

重启samba

systemctl restart smb
systemctl status smb

共享的目录要授权才能进行写的操作

chmod -R 777 /opt
posted @ 2022-10-14 17:56  碎了的冰  阅读(80)  评论(0编辑  收藏  举报