安装samba

1、检测samba是否安装,如果没有,那么可以使用yum来安装。至少需要安装3个软件:samba,samba-client、samba-common

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

samba-winbind-clients-3.6.9-164.el6.i686

samba-client-3.6.9-164.el6.i686

samba-common-3.6.9-164.el6.i686

samba4-libs-4.0.0-58.el6.rc4.i686

samba-winbind-3.6.9-164.el6.i686

[root@localhost pub]# yum install y samba samba-client samba-common    //如果没有,那么可以用此命令安装

2、创建共享目录

[root@localhost /]# mkdir /wj        //创建目录

[root@localhost /]# chmod 777 /wj   //设置权限

3、修改配置文件“/etc/samba/smb.cnf”

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

# ----------------------- Standalone Server Options ------------------------

# Scurity can be set to user, share(deprecated) or server(deprecated)

# Backend to store user information in. New installations should 

# use either tdbsam or ldapsam. smbpasswd is available for backwards 

# compatibility. tdbsam requires no further configuration

    security = share           //这里默认是user,改为share,这样不用输入密码就可访问

    passdb backend = tdbsam

 

    [wj]                //创建共享目录配置

    comment=wj       //名字

    path=/wj         //路径

    read only=no    //是否只读,这里为no,这样用户就可以创建文件夹

    guest ok=yes    //是否允许guest用户登录

    browseable=yes //是否可以浏览目录

4、修改防火墙,打开tcp的端口137、138、139、445

[root@localhost wj]# gedit /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 137 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 138 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT

 

 [root@localhost wj]# service iptables restart

iptables:将链设置为政策 ACCEPTfilter nat                [确定]

iptables:清除防火墙规则:                                 [确定]

iptables:正在卸载模块:                                   [确定]

iptables:应用防火墙规则:                                 [确定]

iptables:载入额外模块:nf_conntrack_ftp                   [确定]

5、启动smb服务

[root@localhost wj]# service smb start

启动 SMB 服务:                                            [确定]

6、测试,在终端输入命令“testparm”,可以看到共享目录的信息

[root@localhost wj]# testparm

Load smb config files from /etc/samba/smb.conf

rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)

Processing section "[homes]"

Processing section "[printers]"

Processing section "[wj]"

WARNING: The security=share option is deprecated

Loaded services file OK.

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

[global]

    workgroup = MYGROUP

    server string = Samba Server Version %v

    security = SHARE

    log file = /var/log/samba/log.%m

    max log size = 50

    idmap config * : backend = tdb

    cups options = raw

 

[homes]

    comment = Home Directories

    read only = No

    browseable = No

 

[printers]

    comment = All Printers

    path = /var/spool/samba

    printable = Yes

    print ok = Yes

    browseable = No

 

[wj]

    comment = wj            //名字

    path = /wj              //路径

    read only = No         //是否只读

    guest ok = Yes         //是否允许guest访问

 

7、从windows测试,按下快捷键“window+r”,在弹出的窗口输入命令“smb:\\192.168.0.113”,可以看到本机的共享目录

做了一个Linux学习的平台,目前出来一个雏形,各位可以参考使用
链接:https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ  密码:n7bk

linux服务器---安装samba的更多相关文章

  1. Linux 下安装Samba 文件共享服务器

    samba文件共享服务可以让linux和linux系统.linux和windows系统之间共享文件 服务查询 默认情况下,Linux系统在默认安装中已经安装了Samba服务包的一部分,为了对整个过程有 ...

  2. CentOS Linux 下安装Samba

    一.Samba简介: Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成.Linux中搭建环境有几个需要使用的软件包: (1)samba-client:这个 ...

  3. linux: Ubuntu安装samba的问题

    Ubuntu安装samba的问题 http://blog.csdn.net/jk110333/article/details/8920841 root@ubuntu:~# apt-get instal ...

  4. 【linux】安装samba服务

    学习linux一般是在虚拟机中进行,这样就需要你在windows与linux虚拟机中切换,Samba是很好的共享服务 下面是在汇文培训时宋老师写的配置samba的过程,很容易就能配置成功.还有一些视频 ...

  5. Linux服务器---安装Tomcat

    安装Tomcat Tomcat作为web服务器实现了对servlet和jsp的支持,centos目前不支持yum方式安装.在使用Tomcat之前,确保你已经安装并配置好了jdk,而且jdk的版本要和t ...

  6. Linux 服务器 安装 memcached

    linux centos 一.memcached的安装 1.下载 memcached-1.4.33.tar.gz.libevent-2.0.22-stable.tar.gz 安装 memcached ...

  7. Linux 服务器 安装 goflyway

    github官方开发主页:https://github.com/coyove/goflyway goflyway的用途就不说了,你能搜到此文章就说明已经知道了. centos和Ubuntu均可使用,其 ...

  8. Linux服务器---安装squid

    安装squid proxy就是软件代理或者代理服务器,而squid就是一种常用的proxy服务 1.安装squid [root@localhost wj]# rpm -qa | grep squid ...

  9. linux服务器---安装swat

    安装swat swat是一个图形化的samba管理软件,可以帮助不熟悉的人去灵活的配置samba服务, 1.安装swat [root@localhost wj]#yum install -y samb ...

随机推荐

  1. springMVC前后台交互

    后台返回json对象: package com.sawshaw.controller; import org.springframework.stereotype.Controller; import ...

  2. Windows Server 2008 R2之六活动目录域服务的卸载

    活动目录域服务的卸载是将DC降级为独立服务器或成员服务器的过程. 在删除活动目录之前,为了防止操作失败操作系统故障,须对系统进行备份.同时,我们还必须对待删除的域控制器进行如下检查 1.是否有操作主控 ...

  3. postgresql----网络地址类型和函数

    本人对网络这块实在是搞不清楚,要是能有人推荐一下资料就好了!不知道有没有跟我一样呢?!所以在这里先贴一点从其他地方搞来的一些IPv4的东东. IPv4主要包括一下5类地址 A类: 0 7位 网络号 2 ...

  4. codeforces 892 - A/B/C

    题目链接:https://cn.vjudge.net/problem/CodeForces-892A Jafar has n cans of cola. Each can is described b ...

  5. ECNU 3260 - 袋鼠妈妈找孩子

    题目链接:http://acm.ecnu.edu.cn/problem/3260/ Time limit per test: 1.5 seconds Time limit all tests: 10. ...

  6. Oracle安装部署之 oracle 11g install linux

    #!/bin/bash#Purpose:Create and config oracle install.#Usage:Log on as the superuser('root') #1.creat ...

  7. LoadRunner-参数化(添加参数值)

    录制完脚本后,想要对脚本重复使用需要对某些值设定为参数,如accounts和password. 1.选中需要参数化的accounts值,点击右键->选择Replace with a parame ...

  8. 【aws】

    云服务器EC2 动态调整云服务器ec2 cpu.内存大小: 在ec2实例上右键,Instance settings--> Change Instance Type 选择一个合适的type 云数据 ...

  9. vueawesomeswiper自定义 导航点

    1,pagination的配置 pagination: { el: '.swiper-paginationfull', // type:'bullets', // bulletElement : 's ...

  10. C++三大特性之多态

    原文地址:https://qunxinghu.github.io/2016/09/08/C++%20%E4%B8%89%E5%A4%A7%E7%89%B9%E6%80%A7%E4%B9%8B%E5%A ...