CentOS 7 简易安装samba服务

2016/04/1516:22:56 2

一、安装samba软件

1、使用yum -y install samba samba-client samba-common安装Samba

2、查看Samba版本信息rpm -qi samba

二、修改配置文件

1、 备份原有的配置文件

# cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

2、在配置文件末尾开始配置,添加如下内容

# vi /etc/samba/smb.conf

[global]

        workgroup = MYGROUP

        server string = Samba Server Version %v

        # log files split per-machine:

        log file = /var/log/samba/log.%m

        netbios name = CentOS 7

        # maximum size of 50KB per log file, then rotate:

        max log size = 50

        security = user

        #security = share

        #map to guest = Bad User

        #passdb backend = tdbsam

[public]

        path = /home/guozi/mount

        public = no

        browsable =yes

        writable = yes

        write list = @guozi

        #guest ok = yes  

        read only = no

三、添加用户

useradd guozi
smbpasswd -a guozi
mkdir -p /home/guozi/mount
chow guozi.guozi -R /home/guozi/mount

四、启动服务

systemctl restart smb.service
systemctl enable smb.service

五、测试

smbclient -L localhost -U guozi

如果出现以下情况,则说明是可以的:

Enter guozi's password:
Domain=[MYGROUP] OS=[Windows 6.1] Server=[Samba 4.2.3]

    Sharename       Type      Comment
    ---------       ----      -------
    Anonymous       Disk      
    IPC$            IPC       IPC Service (Samba Server Version 4.2.3)
Domain=[MYGROUP] OS=[Windows 6.1] Server=[Samba 4.2.3]

    Server               Comment
    ---------            -------

六、windows中连接

输入\\ip\public访问,效果如下图:

QQ截图20160415162347

  • 微信扫码赞助
  • weinxin
  • 支付宝赞助
  • weinxin

发表评论

您必须才能发表评论!

目前评论:2   其中:访客  0   博主  0

    • 果子


      alert(“hello”);

      • 果子

        alter(“hello”)