CentOS7 Samba (Smb)服务搭建

编程入门 行业动态 更新时间:2024-10-24 09:24:39

CentOS7 <a href=https://www.elefans.com/category/jswz/34/1713613.html style=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)服务搭建

本文发布于:2024-03-09 14:23:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1725223.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Samba   Smb

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!