新网创想网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

CenOS7怎么安装配置Samba服务-创新互联

这篇文章主要讲解了“CenOS7怎么安装配置Samba服务”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“CenOS7怎么安装配置Samba服务”吧!

目前成都创新互联公司已为上千家的企业提供了网站建设、域名、虚拟空间、网站运营、企业网站设计、双鸭山网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

实现windows 7与centos 7的文件夹共享,本人的是windows7系统下安装的centos7 虚拟机,桥接模式


不知是不是因为VM的原因,共享文件夹不可用,所以迫不得已使用samba共享,以下是具体步骤,个人验证可用

1、编辑C:\Windows\System32\drivers\etc\hosts

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host
# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost
127.0.0.1 genuine.microsoft.com
127.0.0.1 mpa.one.microsoft.com
127.0.0.1 sls.microsoft.com
192.168.10.187 localhost.localdomain centos
#ip地址是centos的ip,localhost.localdomain表示centos的hostname,最后一个参数centos表示centos的别名,即可以通过\\centos访问centos的共享文件夹

直接打开hosts文件是无法修改的,有两种解决方法:

一是以管理员权限打开记事本程序,然后在记事本程序里打开hosts文件,二是把hosts文件拷贝出来修改后再进行覆盖



安装samba服务相关包


yum install samba samba-client samba-common


查看相关包
~#: rpm -qa| grep samba
samba-common-4.1.1-37.el7_0.x86_64
samba-4.1.1-37.el7_0.x86_64
samba-libs-4.1.1-37.el7_0.x86_64
samba-client-4.1.1-37.el7_0.x86_64


修改smb.conf,最好先备份原文件,以防修改不正确导致smb无法执行

vi /etc/samba/smb.conf

[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = centos
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ============================== 
[Anonymous]
path = /samba/anonymous
browsable =yes
writable = yes
guest ok = yes
read only = no

执行以下命令,启动samba服务

mkdir -p /samba/anonymous
systemctl enable smb.service
systemctl enable nmb.service
systemctl restart smb.service
systemctl restart nmb.service

3、 跳过防火墙

 一种方法是关闭防火墙

 systemctl stop firewalld.service

setenforce 0

二方法是添加规则

firewall-cmd --permanent --zone=public --add-service=samba

firewall-cmd --reload

4 输入\\centos 即可看到共享文件了,so happy~

感谢各位的阅读,以上就是“CenOS7怎么安装配置Samba服务”的内容了,经过本文的学习后,相信大家对CenOS7怎么安装配置Samba服务这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是创新互联,小编将为大家推送更多相关知识点的文章,欢迎关注!

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


文章名称:CenOS7怎么安装配置Samba服务-创新互联
网页链接:http://www.wjwzjz.com/article/cssios.html
在线咨询
服务热线
服务热线:028-86922220
TOP