首页 > 系统相关 >【Linux系统】Centos7系统下配置samba共享

【Linux系统】Centos7系统下配置samba共享

时间:2023-02-17 14:02:49浏览次数:69  
标签:disabled samba x86 CentOS Centos7 64 Linux

(【Linux系统】Centos7系统下配置samba共享)

一、Samba服务介绍

Samba是一套使用SMB(Server Message Block)协议的应用程序, 通过支持这个协议, Samba允许Linux服务器与Windows系统之间进行通信,使跨平台的互访成为可能。Samba采用C/S模式, 其工作机制是让NetBIOS( Windows 网上邻居的通信协议)和SMB两个协议运行于TCP/IP通信协议之上,并且用NetBEUI协议让Windows在“网上邻居”中能浏览Linux服务器。

二、配置yum仓库

1.配置阿里云的yum源

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

2.检查yum仓库状态

[root@server ~]# yum repolist all
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
repo id                                                                   repo name                                                                                      status
C7.0.1406-base/x86_64                                                     CentOS-7.0.1406 - Base                                                                         disabled
C7.0.1406-centosplus/x86_64                                               CentOS-7.0.1406 - CentOSPlus                                                                   disabled
C7.0.1406-extras/x86_64                                                   CentOS-7.0.1406 - Extras                                                                       disabled
C7.0.1406-fasttrack/x86_64                                                CentOS-7.0.1406 - Fasttrack                                                                    disabled
C7.0.1406-updates/x86_64                                                  CentOS-7.0.1406 - Updates                                                                      disabled
C7.1.1503-base/x86_64                                                     CentOS-7.1.1503 - Base                                                                         disabled
C7.1.1503-centosplus/x86_64                                               CentOS-7.1.1503 - CentOSPlus                                                                   disabled
C7.1.1503-extras/x86_64                                                   CentOS-7.1.1503 - Extras                                                                       disabled
C7.1.1503-fasttrack/x86_64                                                CentOS-7.1.1503 - Fasttrack                                                                    disabled
C7.1.1503-updates/x86_64                                                  CentOS-7.1.1503 - Updates                                                                      disabled
C7.2.1511-base/x86_64                                                     CentOS-7.2.1511 - Base                                                                         disabled
C7.2.1511-centosplus/x86_64                                               CentOS-7.2.1511 - CentOSPlus                                                                   disabled
C7.2.1511-extras/x86_64                                                   CentOS-7.2.1511 - Extras                                                                       disabled
C7.2.1511-fasttrack/x86_64                                                CentOS-7.2.1511 - Fasttrack                                                                    disabled
C7.2.1511-updates/x86_64                                                  CentOS-7.2.1511 - Updates                                                                      disabled
C7.3.1611-base/x86_64                                                     CentOS-7.3.1611 - Base                                                                         disabled
C7.3.1611-centosplus/x86_64                                               CentOS-7.3.1611 - CentOSPlus                                                                   disabled
C7.3.1611-extras/x86_64                                                   CentOS-7.3.1611 - Extras                                                                       disabled
C7.3.1611-fasttrack/x86_64                                                CentOS-7.3.1611 - Fasttrack                                                                    disabled
C7.3.1611-updates/x86_64                                                  CentOS-7.3.1611 - Updates                                                                      disabled
C7.4.1708-base/x86_64                                                     CentOS-7.4.1708 - Base                                                                         disabled
C7.4.1708-centosplus/x86_64                                               CentOS-7.4.1708 - CentOSPlus                                                                   disabled
C7.4.1708-extras/x86_64                                                   CentOS-7.4.1708 - Extras                                                                       disabled
C7.4.1708-fasttrack/x86_64                                                CentOS-7.4.1708 - Fasttrack                                                                    disabled
C7.4.1708-updates/x86_64                                                  CentOS-7.4.1708 - Updates                                                                      disabled
C7.5.1804-base/x86_64                                                     CentOS-7.5.1804 - Base                                                                         disabled
C7.5.1804-centosplus/x86_64                                               CentOS-7.5.1804 - CentOSPlus                                                                   disabled
C7.5.1804-extras/x86_64                                                   CentOS-7.5.1804 - Extras                                                                       disabled
C7.5.1804-fasttrack/x86_64                                                CentOS-7.5.1804 - Fasttrack                                                                    disabled
C7.5.1804-updates/x86_64                                                  CentOS-7.5.1804 - Updates                                                                      disabled
!appnode/x86_64                                                           AppNode's RPM repository for Enterprise Linux 7 - x86_64                                       enabled:  4,266
!appnode-agent/x86_64                                                     AppNode Agent Repository - x86_64                                                              enabled:    332
appnode-agent-archive/x86_64                                              AppNode Agent Repository - x86_64                                                              disabled
appnode-agent-development/x86_64                                          AppNode Agent Repository - x86_64                                                              disabled
appnode-archive/x86_64                                                    AppNode's RPM repository for Enterprise Linux 7 - x86_64                                       disabled
!appnode-ccenter/x86_64                                                   AppNode CCenter Repository - x86_64                                                            enabled:     71
appnode-ccenter-archive/x86_64                                            AppNode CCenter Repository - x86_64                                                            disabled
appnode-ccenter-development/x86_64                                        AppNode CCenter Repository - x86_64                                                            disabled
appnode-development/x86_64                                                AppNode's RPM repository for Enterprise Linux 7 - x86_64                                       disabled
!appnode-extras/x86_64                                                    AppNode Extras Repository - x86_64                                                             enabled:     88
appnode-extras-archive/x86_64                                             AppNode Extras Repository - x86_64                                                             disabled
appnode-extras-development/x86_64                                         AppNode Extras Repository - x86_64                                                             disabled
!base/7/x86_64                                                            CentOS-7 - Base - mirrors.aliyun.com                                                           enabled: 10,072
base-debuginfo/x86_64                                                     CentOS-7 - Debuginfo                                                                           disabled
base-source/7                                                             CentOS-7 - Base Sources                                                                        disabled
c7-media                                                                  CentOS-7 - Media                                                                               disabled
centosplus/7/x86_64                                                       CentOS-7 - Plus - mirrors.aliyun.com                                                           disabled
centosplus-source/7                                                       CentOS-7 - Plus Sources                                                                        disabled
contrib/7/x86_64                                                          CentOS-7 - Contrib - mirrors.aliyun.com                                                        disabled
cr/7/x86_64                                                               CentOS-7 - cr                                                                                  disabled
docker-ce-nightly/7/x86_64                                                Docker CE Nightly - x86_64                                                                     disabled
docker-ce-nightly-debuginfo/7/x86_64                                      Docker CE Nightly - Debuginfo x86_64                                                           disabled
docker-ce-nightly-source/7                                                Docker CE Nightly - Sources                                                                    disabled
!docker-ce-stable/7/x86_64                                                Docker CE Stable - x86_64                                                                      enabled:    163
docker-ce-stable-debuginfo/7/x86_64                                       Docker CE Stable - Debuginfo x86_64                                                            disabled
docker-ce-stable-source/7                                                 Docker CE Stable - Sources                                                                     disabled
docker-ce-test/7/x86_64                                                   Docker CE Test - x86_64                                                                        disabled
docker-ce-test-debuginfo/7/x86_64                                         Docker CE Test - Debuginfo x86_64                                                              disabled
docker-ce-test-source/7                                                   Docker CE Test - Sources                                                                       disabled
!epel/x86_64                                                              Extra Packages for Enterprise Linux 7 - x86_64                                                 enabled: 13,757
epel-debuginfo/x86_64                                                     Extra Packages for Enterprise Linux 7 - x86_64 - Debug                                         disabled
epel-source                                                               Extra Packages for Enterprise Linux 7 - x86_64 - Source                                        disabled
!extras/7/x86_64                                                          CentOS-7 - Extras - mirrors.aliyun.com                                                         enabled:    512
extras-source/7                                                           CentOS-7 - Extras Sources                                                                      disabled
fasttrack/7/x86_64                                                        CentOS-7 - fasttrack                                                                           disabled
!updates/7/x86_64                                                         CentOS-7 - Updates - mirrors.aliyun.com                                                        enabled:  4,050
updates-source/7                                                          CentOS-7 - Updates Sources                                                                     disabled

三、安装samba客户端

1.安装samba-client

yum install -y samba-client

2.查看共享状态

[root@server ~]# smbclient -L 192.168.3.100
Enter SAMBA\root's password: 
Anonymous login successful

	Sharename       Type      Comment
	---------       ----      -------
	share           Disk      
	IPC$            IPC       IPC Service (Samba 4.5.16-Debian)
Reconnecting with SMB1 for workgroup listing.
Anonymous login successful

	Server               Comment
	---------            -------

	Workgroup            Master
	---------            -------

四、Linux配置samba服务器

Linux下的samba服务配置详解

家庭NAS搭建实战之samba共享

五、Linux挂载Samba

1.安装相关软件包

yum install  -y nfs-utils  cifs-utils 

2.创建挂载目录

mkdir -p /samba/data

3.挂载samba

mount -t cifs //192.168.3.100/data/NAS/nas /samba/data  -o username=admin,password=123123

3.查看挂载状态

[root@servert ~]# df -h |grep samba
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root     17G  1.2G   16G   7% /
 //192.168.3.100/data/NAS/nas  17G  1.2G   16G   7%  /samba/data

标签:disabled,samba,x86,CentOS,Centos7,64,Linux
From: https://blog.51cto.com/u_14664141/6064028

相关文章

  • linux源码解析12–page数据结构
    几个问题:1.当开启了MMU之后,CPU访问内存的最小单位是多少呢?page2.linux怎样描述这个页呢?3.linux内核里,怎么理解和使用这个页?linux内核用stuctpage来描述一个物理页面:1......
  • linux ip route 配置ECMP
    配置如下:iprouteadd100.0.0.0/16nexthopvia1.1.1.1devvnet0weight1nexthopvia2.2.2.1devvnet1weight1说明:nexhop 指定下一跳dev 指定接口wei......
  • Linux中完全卸载nginx
    前言在开局配置Nginx时有可能会配置错误,报各种错误代码。看不懂或者懒得去看这个报错时,其实最简单的方式是卸载并重装咯。今天就带大家一起学习下,如何彻底卸载nginx程序。......
  • Linux关于权限的理解
    一、shell命令以及运行原理在Linux中我们是命令行操作,而windows是图形化界面,本质上定位都是相同的,都是为了让用户进行相关的操作,刚开始都只有的命令行操作,后来才有了图形化......
  • Linux系列教程(十二)——Linux软件包管理之yum在线管理
    上一篇博客我们介绍了​​rpm包管理之rpm命令管理​​,我们发现在使用rpm命令手动安装rpm包的时候,会发现安装遇到到的依赖让你痛不欲生,安装一个rpm时会要先先安装某个依......
  • linux 中判断一列数值是否都完全相同
     001、 利用awk语句判断root@ubuntu01:/home/test#lsa.txtb.txtroot@ubuntu01:/home/test#cata.txt1234root@ubuntu01:/home/test#catb.txt1111r......
  • linux提示没有rar命令
        linux提示没有rar命令的解决方法?答:没有rar这个命令,不要上传rar,用unzip。 linux下也有rar命令,只是没有默认安装,需要使用包管理工具装一下:https://zhidao......
  • Rsync实现Linux-Windows文件同步
     Window客户端同步到Linux服务器的文件夹:从linux服务器的文件夹里面的内容同步到(复制,覆盖和删除等操作)windows客户端主机.环境:CentOS6.8x64Linux服务器:19......
  • centos7防火墙 使用命令
     一、防火墙的开启、关闭、禁用命令(1)设置开机启用防火墙:systemctlenablefirewalld.service(2)设置开机禁用防火墙:systemctldisablefirewalld.service(3)启动防火墙:syst......
  • lazarus combobox的下拉列表在linux时没有高亮显示选中的item
    lazarusObjectInspector和combobox的下拉列表在linux时没有高亮显示选中的item,在windows是有高亮显示的,按以下方法修改就可以,如果你有更有效的方法也请与我分享。(lazar......