赞
踩
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
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.
进入到:/etc/samba/
[root@localhost samba]# ls
lmhosts smb.conf smb.conf.example
直接在smb.conf 的最后一行添加如下内容:
[repos]
comment = repos Directories
path = /repos
public = yes
writable = yes
write list = root
valid user = root
create mask = 0750
directory mask = 0750
配置完毕之后,需要重启smb 服务才可以生效。
systemctl restart smb
请注意,配置密码时候,需要添加参数 -a
[root@localhost samba]# smbpasswd -a root
New SMB password:
Retype new SMB password:
Added user root.
在我的电脑,右键选择【映射网络驱动器(N)…】
输入路径,如:\192.168.100.128\repos
此时需要输入用户名和密码(即 smbpasswd
设置的密码)
然后点击确定即可。
[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.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。