redhat如何安裝配置samba實現win共用linux主機目錄

來源:互聯網
上載者:User

redhat安裝配置samba實現win共用linux主機目錄

一、安裝前準備

1、使用Samba伺服器需要防火牆開放以下連接埠

UDP 137 UDP 138 TCP 139 TCP 445

#配置防火牆連接埠  www.2cto.com

[root@roothomes ~] vi /etc/sysconfig/iptables

-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

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

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

#重啟防火牆,使規則生效

[root@roothomes ~] /etc/rc.d/init.d/iptables restart

2、關閉CentOS6系統的 SELinux

[root@roothomes ~] vi /etc/selinux/config

#SELINUX=enforcing     #注釋掉

#SELINUXTYPE=targeted  #注釋掉

SELINUX=disabled       #增加

#:wq  儲存。

#重啟系統  www.2cto.com

[root@roothomes ~] shutdown -r now  或者 init 6

二、安裝Samba

1、檢查Samba服務包是否已安裝

[root@roothomes ~] rpm -qa | grep samba

samba-3.5.4-68.el6.x86_64

samba-common-3.5.4-68.el6.x86_64

samba-client-3.5.4-68.el6.x86_64

samba4-libs-4.0.0-23.alpha11.el6.x86_64

samba-winbind-clients-3.5.4-68.el6.x86_64

說明samba已經安裝,如果沒有安裝,運行下面命令安裝 [root@roothomes ~] yum install samba

2、配置samba

[root@roothomes ~] chkconfig smb on  #設定 Samba開機自動啟動

[root@roothomes ~] service smb start      #啟動Samba服務

[root@roothomes ~] /etc/init.d/smb restart  #重啟

[root@roothomes ~] /etc/init.d/smb stop    #停止

[root@roothomes ~] cp /etc/samba/smb.conf  /etc/samba/bak_smb.conf_bak  #備份

[root@roothomes ~] cp /etc/samba/bak_smb.conf_bak  /etc/samba/smb.conf  #恢複

[root@roothomes ~] vi /etc/samba/smb.conf

[global]                           #找到這一行(全域設定標籤),在此行下面添加如下行:

workgroup = WORKGROUP          #工作群組名稱改為 Windows 網路所定義的工作群組名

server string = Samba Server   #設定samba伺服器的主機名稱

security = user                #設定samba伺服器安全層級為user,即以帳號和口令訪問

netbios name = SambaServer     #設定Samba伺服器訪問別名

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.