Centos 7 下简单配置samba

前端之家收集整理的这篇文章主要介绍了Centos 7 下简单配置samba前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

操作环境


Centos 7.2

samba 4.4.4

操作步骤


1.安装samba

#yum -y install samba

2.创建samba所需目录以及user

#mkdir /home/hgcsmb
#useradd -s /sbin/nologin hgcadmin
#smbpasswd -a hgcadmin

3.配置smb目录权限

#chown -R hgcadmin:hgcadmin /home/hgcsmb
#chmod 777 /home/hgcsmb

4.修改smb.conf配置文件如下

# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.

[global]
        workgroup = WORKGROUP
        security =  user 
        server string = Samba Server %v
        netbios name = centos7
        map to guest = bad user
        dns proxy = no

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

[hgcsmb]
        comment = hgcsamba
        path = /home/hgcsmb
        public = no 
        browsable = yes
        writable = yes
        write list = hgcadmin
        validusers = hgcadmin

5.启动smb

#systemctl start smb
#systemctl enable smb

6.通过linux客户端连接该smb

#mount //10.10.200.227/hgcsmb /mnt/ -o user=hgcadmin,password=123456

[root@centos7-zabbix-193 /]# df
Filesystem              1K-blocks      Used Available Use% Mounted on
/dev/mapper/centos-root  18348032  12430436   5917596  68% /
devtmpfs                  1935536         0   1935536   0% /dev
tmpfs                     1941892         0   1941892   0% /dev/shm
tmpfs                     1941892    146532   1795360   8% /run
tmpfs                     1941892         0   1941892   0% /sys/fs/cgroup
/dev/sda1                  508588     99588    409000  20% /boot
tmpfs                      388380         0    388380   0% /run/user/0
//10.10.200.227/hgcsmb  915094976 212562588 702532388  24% /mnt

7.通过windows客户端连接

在windows目录中输入\\10.10.200.227/hgcsmb即可登录,输入对应的user&passwd即可使用.
原文链接:https://www.f2er.com/centos/379421.html

猜你在找的CentOS相关文章