安装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. RabbitMQ安装详解(centos6.8)(转自:http://www.cnblogs.com/zhen-rh/p/6862350.html)

    1.下载rabbitmq安装包 2.安装erlang a.安装Erlang Solutions仓库到你的系统(目的在于让你可以使用yum安装到最新版本的erlang, 如果不设置, yum安装的erl ...

  2. python中的range与xrange

    range 也是一种类型(type),它是一个数字的序列(s sequence of numbers),而且是不可变的,通常用在for循环中. class range(stop) class rang ...

  3. POJ-2336 Ferry Loading II(简单DP)

    Ferry Loading II Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3763 Accepted: 1919 Desc ...

  4. c++之list的用法

    list同vector一样是c++中的一个模板类.关于它的详细内容可查看c++的文档 http://www.cplusplus.com/reference/list/list/ C++中list的使用 ...

  5. POJ 1066 - Treasure Hunt - [枚举+判断线段相交]

    题目链接:http://poj.org/problem?id=1066 Time Limit: 1000MS Memory Limit: 10000K Description Archeologist ...

  6. strut2的标签

         DIY部落 新闻中心 交流论坛 千寻搜索   点击浏览该栏目下的更多电子书  收藏本站   struts2标签详解 文章整理: www.diybl.com 文章来源: 网络 去论坛 建我的b ...

  7. 最长回文 HDU - 3068 manacher 模板题

    题意:找串的最长回文字串(连续) 题解:manacher版题 一些理解:首位加上任意两个字符是为了判断边界. 本算法主要是为了 1.省去奇偶分类讨论. 2.防止形如aaaaaaa的串使得暴力算法蜕化为 ...

  8. CCCC L2-018. 多项式A除以B 直接上map,然后stack处理输出

    https://www.patest.cn/contests/gplt/L2-018 题意:模拟多项式除法. 题解:短除法,初中奥数老师,高中数学老师,高数老师都讲过2333. 模拟之前,关于保存 多 ...

  9. JavaScript之Function 和 Object 的区别和联系

    1.先看一个控制台的输出: instanceof 运算符字面意思是 左边是右边的一个实例吗? 但是这两条输出让人很困惑.Function 是 Object 的实例.Object 也是 Function ...

  10. HTML标签_增加css样式

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...