【linux软件Samba服务器的安装】

一、samba简介

为了能够在Windows和unix之间进行文件的共享,支持文件的直接修改,而不是通过拷贝文件来进行更新,samba 诞生了。我们都知道unix之间可以NFS服务器来实现文件的共享,Windows之间通过CIFS,即网上邻居来进行共享,samba的诞生就是为了能够使Windows能够访问Unix的资源,包括文件,打印机等。

二、软件安装

1、检查软件包是否存在

samba-common-3.0.33-3.7.el5-------公共软件包
samba-client-3.0.33-3.7.el5-----------客户机软件包
samba-3.0.33-3.7.el5--------------------服务器软件包

[root@hadoop0 ~]# rpm -qa | grep samba
samba-winbind-3.6.9-151.el6.i686
samba-winbind-clients-3.6.9-151.el6.i686
samba-common-3.6.9-151.el6.i686
[root@hadoop0 ~]# cd /etc/samba
[root@hadoop0 samba]# mv smb.conf smb.confbak
[root@hadoop0 samba]# touch smb.conf
[root@hadoop0 samba]# vi smb.conf
[global]


     workgroup = LinuxSir
    netbios name = LinuxSir05
    server string = Linux Samba Server TestServer
    security = share

 [linuxsir]
        path = /opt/linuxsir
        writeable = yes
        browseable = yes
        guest ok = yes
~
"smb.conf" 13L, 248C written
[root@hadoop0 samba]#  mkdir -p /opt/linuxsir
[root@hadoop0 samba]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)
[root@hadoop0 samba]# chown -R nobody:nobody /opt/linuxsir 
[root@hadoop0 samba]#  smbd
-bash: smbd: command not found
[root@hadoop0 samba]# nmbd
-bash: nmbd: command not found
[root@hadoop0 samba]# service smbd start
smbd: unrecognized service
[root@hadoop0 samba]# rpm -qa *smb*
[root@hadoop0 samba]# yum install samba
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
 * base: mirrors.pubyun.com
 * extras: mirrors.pubyun.com
 * updates: mirrors.aliyun.com
base                                                                                                                    | 3.7 kB     00:00    
extras                                                                                                                  | 3.4 kB     00:00    
updates                                                                                                               | 3.4 kB     00:00    
updates/primary_db                                                                                            | 3.7 MB     00:05    
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package samba.i686 0:3.6.23-24.el6_7 will be installed
--> Processing Dependency: samba3.6.23-24.el6_7 for package: samba-3.6.23-24.el6_7.i686
--> Processing Dependency: samba-common = 3.6.23-24.el6_7 for package: samba-3.6.23-24.el6_7.i686
--> Processing Dependency: libtevent.so.0(TEVENT_0.9.9) for package: samba-3.6.23-24.el6_7.i686
--> Processing Dependency: libtevent.so.0 for package: samba-3.6.23-24.el6_7.i686
--> Running transaction check
---> Package libtevent.i686 0:0.9.18-3.el6 will be installed
---> Package samba-common.i686 0:3.6.9-151.el6 will be updated
--> Processing Dependency: samba-common = 3.6.9-151.el6

---> Package samba-common.i686 0:3.6.23-24.el6_7 will be an update
---> Package samba-winbind-clients.i686 0:3.6.9-151.el6 will be updated
--> Processing Dependency: samba-winbind-clients = 3.6.9-151.el6 : libsmbclient-3.6.9-151.el6.i686
---> Package samba-winbind-clients.i686 0:3.6.23-24.el6_7 will be an update
--> Running transaction check
---> Package libsmbclient.i686 0:3.6.9-151.el6 will be updated
---> Package libsmbclient.i686 0:3.6.23-24.el6_7 will be an update
---> Package samba-winbind.i686 0:3.6.9-151.el6 will be updated
---> Package samba-winbind.i686 0:3.6.23-24.el6_7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================================
 Package               Arch                                  Version            Repository                                Size
=============================================================================================================================================
Installing:
 samba                          i686             3.6.23-24.el6_7           updates                                  5.0 M
Installing for dependencies:
 libtevent                        i686             0.9.18-3.el6                 base                                      27 k
Updating for dependencies:
 libsmbclient                    i686              3.6.23-24.el6_7           updates                              1.6 M
 samba-common               i686            3.6.23-24.el6_7        updates                                  9.9 M
 samba-winbind               i686             3.6.23-24.el6_7          updates                                2.2 M
 samba-winbind-clients     i686            3.6.23-24.el6_7       updates                                  2.0 M

Transaction Summary
==========================================
Install       2 Package(s)
Upgrade       4 Package(s)

Total download size: 21 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): libsmbclient-3.6.23-24.el6_7.i686.rpm                              | 1.6 MB     00:02    
(2/6): libtevent-0.9.18 3.el6.i686.rpm                                           |  27 kB     00:00    
(3/6): samba-3.6.23-24.el6_7.i686.rpm                                       | 5.0 MB     00:09    
(4/6): samba-common-3.6.23-24.el6_7.i686.rpm                         | 9.9 MB     00:14    
(5/6): samba-winbind-3.6.23-24.el6_7.i686.rpm                           | 2.2 MB     00:03    
(6/6): samba-winbind-clients-3.6.23-24.el6_7.i686.rpm                | 2.0 MB     00:02    
----------------------------------------------------------------------------------
Total                                                                                                                                                          644 kB/s |  21 MB     00:32    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : libtevent-0.9.18-3.el6.i686                                                                1/10
  Updating   : samba-winbind-3.6.23-24.el6_7.i686                                                           2/10
  Updating   : samba-winbind-clients-3.6.23-24.el6_7.i686                                                       3/10
  Updating   : samba-common-3.6.23-24.el6_7.i686                                     4/10
  Installing : samba-3.6.23-24.el6_7.i686                                                                    5/10
  Updating   : libsmbclient-3.6.23-24.el6_7.i686                                              6/10
  Cleanup    : libsmbclient-3.6.9-151.el6.i686                                                  7/10
  Cleanup    : samba-common-3.6.9-151.el6.i686                                           8/10
  Cleanup    : samba-winbind-3.6.9-151.el6.i686                                             9/10
  Cleanup    : samba-winbind-clients-3.6.9-151.el6.i686                                 10/10 
  

Complete!
[root@hadoop0 samba]# cat /etc/samba
cat: /etc/samba: Is a directory
[root@hadoop0 samba]# cat /etc/samba/smb.conf
[global]


     workgroup = LinuxSir
    netbios name = LinuxSir05
    server string = Linux Samba Server TestServer
    security = share

 [linuxsir]
        path = /opt/linuxsir
        writeable = yes
        browseable = yes
        guest ok = yes
[root@hadoop0 samba]# smbd
[root@hadoop0 samba]# nmbd
[root@hadoop0 samba]# ^C
[root@hadoop0 samba]# echo "linux test" >/opt/linuxsir/test.log
[root@hadoop0 samba]#

猜你喜欢

转载自gaojingsong.iteye.com/blog/2278948