centos7 samb 装置ITeye - AG环亚娱乐

centos7 samb 装置ITeye

2019年03月24日12时01分08秒 | 作者: 浩博 | 标签: 装置,同享,修正 | 浏览: 2013

CenOS 7 装置装备Samba效劳
分类: Linux操作 2014-08-28 16:57 6690人阅览 谈论(0) 保藏 告发
参阅http://www.howtoforge.com/samba-server-installation-and-configuration-on-centos-7
完成windows 7与centos 7的文件夹同享,自己的是windows7体系下装置的centos7 虚拟机,桥接形式
不知是不是由于VM的原因,同享文件夹不可用,所以无可奈何运用samba同享,以下是具体步骤,个人验证可用
1、修正C:\Windows\System32\drivers\etc\hosts
 
[plain] view plaincopyprint?在CODE上检查代码片派生到我的代码片
# 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的同享文件夹 /span  

直接翻开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
[plain] view plaincopyprint?在CODE上检查代码片派生到我的代码片
[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~




#ip地址是centos的ip,localhost.localdomain表明centos的hostname,最终一个参数centos表明centos的别号,即可以经过\\centos拜访centos的同享文件夹
版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表AG环亚娱乐立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章