搭建samba服务器

samba服务器 配置
1.关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl disable NetworkManager
systemctl stop NetworkManager
systemctl enable network
systemctl start network
setenforce 0
vim /etc/selinux/config
     //
     SELINUX=disabled
    //
2.检查是否按照samba
[root@controller ~]#  rpm -qa | grep samba 
3.安装samba
[root@controller ~]# yum install -y samba
4.启动与停止samba服务,设置开机启动
[root@localhost ~]# systemctl start smb     //启动服务
[root@localhost ~]# systemctl enable smb   //开机自启
[root@localhost ~]# systemctl restart smb  //重启服务
[root@localhost ~]# systemctl stop smb    // 停止服务
[root@localhost ~]# systemctl start smb     //启动服务
5.主要配置文件smb.conf
cd /
  [root@controller /]# mkdir share
[root@controller /]# cd share
[root@controller share]# mkdir wk
cd    /etc/samba 
vim /etc/samba/smb.conf
[wk]
        comment = wkdoc
        path = /share/wk
        browseable = yes
        read only = no
        public = Yes
 
5.samba服务密码文件
.建立Linux系统账号reading设置密码
[root@localhost ~]# useradd reading 创建用户
[root@localhost ~]# passwd reading  设置密码为“123456”
[root@localhost ~]# smbpasswd -a reading把用户与samba关联,之后输入用户密码“123456”
chmod 777 /share
chmod 777/share/wk
[root@localhost ~]# systemctl restart smb  //重启服务
6.Windows 客户端
Samba服务程序可以解决Linux系统和Windows系统的资源共享问题
要在Windows系统中访问共享资源,只需要在命令框中输入两个反斜杠,然后再加服务器的IP地址即可.添加reading用户的samba账户
//192.168.16.128
7.Linux 客户端
Samba服务程序还可以实现Linux系统之间的文件共享
客户端安装支持文件共享服务的软件包cifs-utils
[root@localhost ~]# yum install cifs-utils
[root@localhost database]# yum install samba-client
[root@localhost ~]mkdir /database
[root@localhost database]# chmod 777 /database
[root@localhost ~]# mount -t cifs -o username=reading,password=123456 //192.168.16.128/wk  /database
 或
 [root@localhost database]#  smbclient  //192.168.16.128/wk  -U reading%123456
smb: \> ls


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

离陌殇殃

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

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

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

打赏作者

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

抵扣说明:

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

余额充值