Samba (Smb)服务搭建"/>
CentOS7 Samba (Smb)服务搭建
平台
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
安装Smb服务
安装samba工具
yum install samba
打开服务
systemctl start smb
systemctl status smb
设置开机启动
[root@localhost ~]# systemctl enable smb
Created symlink from /etc/systemd/system/multi-user.target.wants/smb.service to /usr/lib/systemd/system/smb.service.
配置Samba服务
配置文件
进入到:/etc/samba/
[root@localhost samba]# ls
lmhosts smb.conf smb.conf.example
直接在smb.conf 的最后一行添加如下内容:
[repos]comment = repos Directoriespath = /repospublic = yeswritable = yeswrite list = rootvalid user = rootcreate mask = 0750directory mask = 0750
配置完毕之后,需要重启smb 服务才可以生效。
systemctl restart smb
设置密码
请注意,配置密码时候,需要添加参数 -a
[root@localhost samba]# smbpasswd -a root
New SMB password:
Retype new SMB password:
Added user root.
Win10 访问
在我的电脑,右键选择【映射网络驱动器(N)…】
输入路径,如:\192.168.100.128\repos
此时需要输入用户名和密码(即 smbpasswd
设置的密码)
然后点击确定即可。
FAQ
Failed to find entry for user root
[root@localhost samba]# smbpasswd root
New SMB password:
Retype new SMB password:
Failed to find entry for user root.
解决办法是:
[root@localhost samba]# smbpasswd -a root
New SMB password:
Retype new SMB password:
Added user root.
Reference
CentOS 7下Samba服务器的安装与配置
更多推荐
CentOS7 Samba (Smb)服务搭建
发布评论