您好,欢迎来到化拓教育网。
搜索
您的当前位置:首页配置和管理Samba服务器简短详细步骤

配置和管理Samba服务器简短详细步骤

来源:化拓教育网

配置和管理Samba服务器

1,检测系统是否安装了 Samba相关性软件包

[root@localhost ~]# rpm -qa|grep samba

[root@localhost ~]# mkdir -p  /opt/centos

[root@localhost ~]# mount /dev/cdrom  /opt/centos

#mount: /dev/sr0 写保护,将以只读方式挂载

[root@localhost ~]# cd /etc/yum.repos.d/

[root@localhost yum.repos.d]# mv /etc/yum.repos.d/*  /home/

6,进入local.repo进行编辑

[root@localhost yum.repos.d]# vim local.repo

编辑内容:

[centos]

name=dvd

baseurl=file:///opt/centos      //特别注意本地源文件的表示,3个“/”

gpgcheck=0

enabled=1

7,安装前先清除缓存

[root@localhost yum.repos.d]# yum clean all

#已加载插件:fastestmirror, langpacks

#正在清理软件源:centos

8,列出已启用的存储库

[root@localhost ~]# yum repolist

9,使用yum 命令安装 samba服务

[root@localhost ~]# yum install samba -y

10,ping一下baidu.com 测试连通性

[root@localhost ~]# ping baidu.com

11,再次检查,是否安装好

[root@localhost ~]# yum install samba -y

12,所有软件包安装完毕,使用rpm命令再一次进行查询,会发现多出了几个新的内容,这就是刚刚所安装的内容

[root@localhost ~]# rpm -qa | grep samba

13,重启一下samba服务

[root@localhost ~]# systemctl start smb

14,关闭防火墙

[root@localhost ~]# systemctl stop firewalld

15,重新启动

[root@localhost ~]# systemctl restart smb nmb

进入vim /etc/samba/smb.conf内修改

[root@localhost ~]# vim /etc/samba/smb.conf

重启一下Smaba更新配置

17,创建用户s1并设置密码

[root@localhost ~]# useradd s1

[root@localhost ~]# passwd s1

重新设置s1密码

[root@localhost ~]# smbpasswd -a s1

[root@localhost ~]# mkdir /share

[root@localhost ~]# cd /share

创建文件abc.txt并查看

[root@localhost share]# touch abc.txt

[root@localhost share]# ll abc.txt

-rw-r--r--. 1 root root 0 11月  9 15:34 abc.txt

[root@localhost share]# ll -d /share

19,编辑刚刚创建的文件/etc/samba/smb.conf

[root@localhost ~]# vim /etc/samba/smb.conf

[share]

comment =my share

 path=/share

 public=no

 read only=yes

 valid users=s1

[root@localhost ~]# chown s1:root /share

[root@localhost ~]# ll -d /share/

21,重启一下Samba服务

[root@localhost ~]# systemctl restart smb

服务器配置完毕

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- huatuo9.cn 版权所有 赣ICP备2023008801号-1

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务