RHEL6.3 Samba伺服器安裝配置

來源:互聯網
上載者:User


RHEL6.3 Samba伺服器安裝配置 1、安裝Samba軟體包  www.2cto.com  # yum -y install samba samba-client samba-common samba-winbind samba-winbind-clients 2、啟動、查看Samba伺服器狀態 # service smb start# service smb status  3、設定Samba伺服器為開機啟動 # chkconfig smb on# chkconfig --list smbsmb             0:off   1:off   2:on   3:on   4:on   5:on   6:off  4、修改 Samba 伺服器住設定檔 smb.conf  4.1、備份源檔案 # cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig  4.2、在 [global] 部分修改字元集設定 [global]       unix charset= UTF-8       dos charset=GBK              workgroup = SHAREGROUP 4.3、在檔案結尾加上客戶自訂共用模組  www.2cto.com  [share] comment = RHEL6-Windows Sharepath=/home/sharewriteable = yes # 是否可寫browseable = yes# 是否可瀏覽create mode = 0777# 建立檔案時的預設屬性directory mode = 0777# 建立目錄時的預設屬性valid users = share# 指定可訪問使用者 5、添加共用使用者 # groupadd -g 1234 share-users# adduser -d /home/share -m -u 1234 -g 1234 -c "Samba demo user accnt" share# ls -ld /home/sharedrwx------. 4 share share-users 4096 11月 28 16:56 /home/share  www.2cto.com  6、映射剛添加的使用者為同名的 samba 使用者,並設定samba密碼(這個密碼不同於系統使用者密碼!!) # smbpasswd -a shareNew SMB password: Retype new SMB password:Added user demo. # 修改Samba使用者資訊使用pdbedit命令:        pdbedit -a username #建立Samba使用者        pdbedit -x username #刪除Samba使用者        pdbedit -L      #列出Samba使用者列表,讀取passdb.tdb資料庫檔案        pdbedit -Lv     #列出Samba使用者列表的詳細資料        pdbedit -c "[D]" -u username    #暫停該Samba使用者的帳號        pdbedit -c "[]" -u username #恢複該Samba使用者的帳號                修改Samba使用者share的密碼:smbpasswd share     #必須先添加Linux使用者到Samba使用者 7、檢測配置參數 # testparm 8、配置 SELinux Security 參數 8.1、/etc/selinux/config SELINUX=enforcing 8.2、設定檔案夾及其內容的安全屬性 # semanage fcontext -a -t samba_share_t "/home/share(/.*)?"# restorecon -R -v /home/share PS:如果 semanage 命令不存在,可以使用這個命令 # yum -y install policycoreutils-python 安裝 8.3、在防火牆上開啟 Samba 和 Samba-client 服務連接埠 9、重啟 Samba 伺服器 service smb restart PS:WINDOWS機器需要登出重新登入,才可以登出原有的使用者資訊,登入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.