Centos之samba

安装samba-common、samba、samba-client:

[root@localhost Desktop]# yum install samba-common
、、、
Complete!
[root@localhost Desktop]# yum install samba
、、、
Complete!
[root@localhost Desktop]# yum install samba-client
、、、
Complete!

当Samba服务器的安全级别为用户时,用户访问Samba服务器时必须提供该用户名和密码,而只有Linux系统本身的用户才能成为Samba用户,并需设置其Samba密码。所以接下来要创建新的系统用户名和密码,并另之成为Samba用户。


设置系统用户名和密码:

[root@localhost ~]# cd /home
[root@localhost home]# useradd sambtext
[root@localhost home]# passwd
Changing password for user root.
New password:         //设置密码123456,此处密码输入屏幕不会显示输入
BAD PASSWORD: it is too simplistic/systematic
BAD PASSWORD: is too simple
Retype new password: 
passwd: all authentication tokens updated successfully.

设置Samba用户名和密码:

[root@localhost home]# smbpasswd -a sambtext
New SMB password:     //设置密码123456,此处密码输入屏幕不会显示输入
Retype new SMB password:
Added user sambtext.

新建好的用户文件夹放在/home目录下:

[root@localhost home]# ls
hhh sambtext

在sambtext目录下创建要分享的文件夹sharedoc:

[root@localhost home]# cd sambtext/
[root@localhost sambtext]# mkdir sharedoc
[root@localhost sambtext]# ll
total 4
drwxr-xr-x. 2 root root 4096 Jun 25 03:58 sharedoc

进入配置文件:

[root@localhost sambtext]# cd /etc/samba/
[root@localhost samba]# ls
lmhosts  sharedoc  smb.conf  smbusers
[root@localhost samba]# vim smb.conf

这里写图片描述

这里如果是user,则访问Samba服务器需要账户密码;如果是share,则不需要密码:
这里写图片描述

共享模式(share):

Backend to store user information in. New installations should 
use either tdbsam or ldapsam. smbpasswd is available for backwards 
compatibility. tdbsam requires no further configuration.

        security = share
        passdb backend = tdbsam


----------------------- Domain Members Options ------------------------

删除注释:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Silversonja

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值