centos安裝配置samba檔案伺服器

來源:互聯網
上載者:User

標籤:samba伺服器   防火牆   centos   

一、要求:

1、公司有兩個部門,美術部和運營部。

2、有三個檔案夾分別是meishu、yunying和public

3、public包括meishu和yunying

4、美術部對meishu和public/meishu可讀可寫,對yunying檔案夾沒有許可權開啟,對public/yunying可讀;

5、運營部對yunying和public/yunying可讀可寫,對meishu檔案夾沒有許可權開啟,對public/meishu可讀;


二、開啟防火牆samba相應連接埠或者直接關閉防火牆,這裡直接關閉。

#/etc/init.d/iptables stop

在/etc/selinux下的config裡面設定SELINUX=disabled


三、安裝samba

1、#yum -y install samba samba-client samba-swat

有依賴關係的包samba-common、samba-winbind-clients、libsmbclient將自動安裝上去。

啟動samba: 

#/etc/init.d/smb start

#/etc/init.d/nmb start


2、設定開機啟動

#chkconfig --add smb

#chkconfig --add nmb

#chkconfig smb on

#chkconfig nmb on


四、配置samba

設定檔是/etc/samba/smb.conf


1、建立相關使用者和使用者組

#useradd -s /sbin/nologin msadmin

#useradd -g msadmin -s /sbin/nologin maomao

#useradd -s /sbin/nologin yyadmin

#useradd -g yyadmin -s /sbin/nologin zyq

#useradd -s /sbin/nologin admin 

2、設定使用者密碼

#smbpasswd -a msadmin (其他類似)

3、建立相應檔案夾

#mkdir -p /home/{meishu,yunying,public}

#mkdir -p /home/public/{meishu,yunying}

4、設定檔案夾許可權

#cd /home

#chown msadmin.msadmin meishu

#chown yyadmin.yyadmin yunying

#chown admin.admin public

#cd /home/public

#chown msadmin.msadmin meishu && chown yyadmin.yyadmin yunying

#chmod 1775 meishu yunying (這步很重要,要實現各部門人員對其有可寫入權限)


5、smb.conf配置如下:

#======================= Global Settings =====================================


[global]


# ----------------------- Network Related Options -------------------------

#

# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH

#

# server string is the equivalent of the NT Description field

#

# netbios name can be used to specify a server name not tied to the hostname


        workgroup = WORKGROUP

        server string = shyy Samba Server Version %v

        netbios name = ShyySamba


# --------------------------- Logging Options -----------------------------

#

# Log File let you specify where to put logs and how to split them up.


        log file = /var/log/samba/log.%m

        max log size = 50


# ----------------------- Standalone Server Options ------------------------

#

# Scurity can be set to user, share(deprecated) or server(deprecated)


        security = user

        passdb backend = tdbsam


#============================ Share Definitions ==============================


[meishu]

     comment = This is a directory of meishu.

     path = /home/meishu

     public = no

     admin users = msadmin

     valid users = @msadmin

#     writable = yes

     write list = @msadmin

     create mask = 0750

     directory mask = 0750


[yunying]

     comment = This is a directory of yunyhing.

     path = /home/yunying

     public = no

     admin users = yyadmin

     valid users = @yyadmin

 #    writable = yes

     write list = @yyadmin

     create mask = 0750

     directory mask = 0750


[renshi]

     comment = This is a directory of renshi.

     path = /shyygame/renshi

     public = no

     admin users = hradmin

     valid users = @hradmin

  #   writable = yes

     write list = @hradmin

     create mask = 0750

     directory mask = 0750



[public]

     comment = This is a share directory.

     path = /home/public

     public = no

     valid users = admin,@hradmin,@msadmin,@yyadmin

     write list = @msadmin,@yyadmin,@hradmin

   #  writable = yes

     create mask = 0750

     directory mask = 0750

測試組態命令:#testparm

五、登入

1、linux用戶端串連共用伺服器

#smbclient //ip/public

2、windows用戶端串連共用伺服器

在地址欄中輸入 \\ip或者在網路位置中找到共用的機器雙擊,之後要求輸入賬密。



centos安裝配置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.