Samba服务

linux 与window连接

安装Samba服务软件包  yum install samba

备份原始的配置文件  mv /etc/samba/smb.conf /etc/samba/smb.conf.bak

过滤无用信息  cat /etc/samba/smb.conf.bak | grep -v "#" | grep -v ";" | grep -v "^$" > /etc/samba/smb.conf

检查当前是否为user验证模式  cat /etc/samba/smb.conf

创建共享文件夹  mkdir /database

在smb.conf的文件下面追加共享文件夹的配置参数  

[database]
comment = Do not arbitrarily modify the database file
path = /database
public = no
writable = yes

保存后,重启启动SMB服务  systemctl restart smb

使用windows主机访问

在运行框(win+R)中输入远程主机的信息 \\192.168.21.200

创建SMB服务独立的账号  (SMB服务配置文件中密码数据库后台类型为"tdbsam",所以这个帐户和口令是samba服务的独立账号信息我们需要用pdbedit命令创建SMB服务的用户数据库。)

useradd smbuser  将此用户提升为SMB用户  pdbedit -a -u smbuser

使用windows来验证结果

图示如下

 

posted @ 2019-10-30 19:40  漩溺  阅读(178)  评论(0编辑  收藏  举报