操作环境
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目录权限
# 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即可使用.