Samba配置

来源:互联网 发布:淘宝数据包里面是什么 编辑:程序博客网 时间:2024/06/03 18:15

前提:1.能从Windows 上ping通Linux的IP

           2.关闭Linux防火墙

                Centos防火墙操作:/etc/init.d/iptables stop/start

                Ubuntu防火墙操作:ufw disable / enable

1. 安装smb

centos:yum install -y samba

Ubuntu:apt-get install samba

在Ubuntu下安装如果遇到依赖问题,先将其卸载:apt-get remove 依

2. 添加用户(此处使用root用户)

设置root用户登录Samba服务器的密码

smbpasswd -a root

3. 配置Samba

vim /etc/samba/smb.conf

path:通过smb访问的目录

browseable:允许浏览

writable:允许写入

valid users:通过root用户访问

[root]comment = Root Directoriespath = /browseable = yeswritable = yesvalid users = root[homes]comment = Home Directoriesbrowseable = nowritable = yes;valid users = %S;valid users = MYDOMAIN\%S[printers]comment = All Printerspath = /var/spool/sambabrowseable = noguest ok = nowritable = noprintable = yes


4. 重新启动smb服务器

/etc/init.d/smb restart

Ubuntu下使用上面的命令报错,此处应使用 service smbd start / stop / restart

5. setenforce permissive 关闭selinux

原创粉丝点击