samba笔记

############

1.安装网络yum

############

2.安装createrepo

[root@localhost ~]# yum install createrepo-0.9.8-5.el6.noarch.rpm 
Setting up Install Process
Examining createrepo-0.9.8-5.el6.noarch.rpm: createrepo-0.9.8-5.el6.noarch
Marking createrepo-0.9.8-5.el6.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package createrepo.noarch 0:0.9.8-5.el6 will be installed
--> Processing Dependency: deltarpm for package: createrepo-0.9.8-5.el6.noarch
--> Processing Dependency: python-deltarpm for package: createrepo-0.9.8-5.el6.noarch
--> Running transaction check
---> Package deltarpm.i686 0:3.5-0.5.20090913git.el6 will be installed
---> Package python-deltarpm.i686 0:3.5-0.5.20090913git.el6 will be installed
--> Finished Dependency Resolution


Dependencies Resolved


================================================================================
 Package    Arch   Version                 Repository                      Size
================================================================================
Installing:
 createrepo noarch 0.9.8-5.el6             /createrepo-0.9.8-5.el6.noarch 245 k
Installing for dependencies:
 deltarpm   i686   3.5-0.5.20090913git.el6 base                            73 k
 python-deltarpm
            i686   3.5-0.5.20090913git.el6 base                            27 k


Transaction Summary
================================================================================
Install       3 Package(s)


Total size: 346 k
Total download size: 101 k
Installed size: 478 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): deltarpm-3.5-0.5.20090913git.el6.i686.rpm         |  73 kB     00:00     
(2/2): python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm  |  27 kB     00:00     
--------------------------------------------------------------------------------
Total                                           5.9 kB/s | 101 kB     00:16     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : deltarpm-3.5-0.5.20090913git.el6.i686                        1/3 
  Installing : python-deltarpm-3.5-0.5.20090913git.el6.i686                 2/3 
  Installing : createrepo-0.9.8-5.el6.noarch                                3/3 
  Verifying  : createrepo-0.9.8-5.el6.noarch                                1/3 
  Verifying  : deltarpm-3.5-0.5.20090913git.el6.i686                        2/3 
  Verifying  : python-deltarpm-3.5-0.5.20090913git.el6.i686                 3/3 


Installed:
  createrepo.noarch 0:0.9.8-5.el6                                               


Dependency Installed:
  deltarpm.i686 0:3.5-0.5.20090913git.el6                                       
  python-deltarpm.i686 0:3.5-0.5.20090913git.el6                                


Complete!
#####################

3.安装samba

[root@localhost centos6.4]# yum install samba
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package samba.i686 0:3.6.9-151.el6 will be installed
--> Finished Dependency Resolution


Dependencies Resolved


================================================================================
 Package         Arch           Version                    Repository      Size
================================================================================
Installing:
 samba           i686           3.6.9-151.el6              base           5.1 M


Transaction Summary
================================================================================
Install       1 Package(s)


Total download size: 5.1 M
Installed size: 18 M
Is this ok [y/N]: y
Downloading Packages:
samba-3.6.9-151.el6.i686.rpm                             | 5.1 MB     00:10     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : samba-3.6.9-151.el6.i686                                     1/1 
  Verifying  : samba-3.6.9-151.el6.i686                                     1/1 


Installed:
  samba.i686 0:3.6.9-151.el6                                                    


Complete!
##############

4.安装 Samba 图形化管理工具

# rpm -ivh samba-swat-3.0.25b-0.el5.4.i386.rpm

[root@localhost centos6.4]# rpm -aq | grep samba
samba4-libs-4.0.0-55.el6.rc4.i686
samba-winbind-3.6.9-151.el6.i686
samba-3.6.9-151.el6.i686
samba-common-3.6.9-151.el6.i686
samba-client-3.6.9-151.el6.i686
samba-winbind-clients-3.6.9-151.el6.i686
[root@localhost centos6.4]# yum install samba-swat
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package samba-swat.i686 0:3.6.9-151.el6 will be installed
--> Finished Dependency Resolution


Dependencies Resolved


================================================================================
 Package             Arch          Version                  Repository     Size
================================================================================
Installing:
 samba-swat          i686          3.6.9-151.el6            base          7.3 M


Transaction Summary
================================================================================
Install       1 Package(s)


Total download size: 7.3 M
Installed size: 17 M
Is this ok [y/N]: y
Downloading Packages:
samba-swat-3.6.9-151.el6.i686.rpm                        | 7.3 MB     00:16     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : samba-swat-3.6.9-151.el6.i686                                1/1 
  Verifying  : samba-swat-3.6.9-151.el6.i686                                1/1 


Installed:
  samba-swat.i686 0:3.6.9-151.el6                                               


Complete!
####################

5.设置一个无密码,共享服务器

[global]          //该设置与Samba服务整体运行环境有关,它的设置项目针对所有共享资源   
        workgroup = MYGROUP
        server string = Samba Server Version %v
        netbios name = MYSERVER


        log file = /var/log/samba/log.%m
        max log size = 50


        security = share
        passdb backend = tdbsam                                
netbios name = MYSERVER


        load printers = yes
        cups options = raw


[public]
        comment = aaaaaa
        path = /abc
        public = yes
        writables = no  //是否允许用户写入自己的主目录
        guest ok = yes




[root@localhost samba]# chown -R nobody:nobody /abc     
[root@localhost samba]# service smb restart
Shutting down SMB services: [  OK  ]
Starting SMB services: [  OK  ]
[root@localhost samba]# service nmb restart
Shutting down NMB services: [  OK  ]
Starting NMB services: [  OK  ]
######################################

6.

[root@localhost samba]# 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 "[public]"
Unknown parameter encountered: "writables"
Ignoring unknown parameter "writables"
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
        netbios name = MYSERVER
        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


[public]
        comment = aaaaaa
        path = /abc
        guest ok = Yes

##################################

7.

[root@localhost samba]#  smbclient -L //127.0.0.1
WARNING: The security=share option is deprecated
Enter root's password: 
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.6.9-151.el6]


        Sharename       Type      Comment
        ---------       ----      -------
        public          Disk      aaaaaa
        IPC$            IPC       IPC Service (Samba Server Version 3.6.9-151.el6)
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.6.9-151.el6]


        Server               Comment
        ---------            -------
        MYSERVER             Samba Server Version 3.6.9-151.el6


        Workgroup            Master
        ---------            -------
        MYGROUP              MYSERVER
        WORKGROUP            MENG

##############################################

8.

[root@localhost samba]# smbclient //192.168.1.109/public
WARNING: The security=share option is deprecated
Enter root's password: 
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.6.9-151.el6]
Server not using user level security and no password supplied.
smb: \> ls
NT_STATUS_ACCESS_DENIED listing \*     //拒绝访问
smb: \>


###########################################

9.检查防火墙

[root@localhost samba]# getenforce
Enforcing
[root@localhost samba]# setenforce 0  //关闭防火墙


[root@localhost samba]# smbclient //192.168.1.109/public  //重新登陆
WARNING: The security=share option is deprecated
Enter root's password: 
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.6.9-151.el6]
Server not using user level security and no password supplied.
smb: \> ls
  .                                   D        0  Tue Jul 23 13:31:29 2013
  ..                                 DR        0  Tue Jul 23 13:31:09 2013
  kkk                                         20  Tue Jul 23 13:31:29 2013


                56797 blocks of size 524288. 38949 blocks available
smb: \>


成功!

转载于:https://www.cnblogs.com/a3470194/p/5478900.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值