Centos 安裝配置 samba 服務

簡介

    Samba是一個能讓Linux系統應用Microsoft網絡通信協議的軟件,而SMB是Server Message Block的縮寫,即爲服務器消息塊 ,SMB主要是做爲Microsoft的網絡通信協議,後來Samba將SMB通訊協議應用到了Linux系統上,就造成了如今的Samba軟件。後來微軟又把 SMB 更名爲 CIFS(Common Internet File System),即公共 Internet 文件系統,而且加入了許多新的功能,這樣一來,使得Samba具備了更強大的功能。html

 

安裝

    yum install samba samba-client samba-swatlinux

    選用 yum 方式安裝,selinux disablecentos

    因爲是內部服務器,因此 iptables 是關掉的,systemctl stop iptables服務器

 

配置

    samba 的配置文件爲:/etc/samba/smb.conf網絡

    useradd username 測試

    smbpasswd -a usernameui

    建立用戶,並將用戶添加至samba 服務;spa

#################################################################.net

[public]
                comment = public
                path = /home/samba/public
                writable = yes
                valid user = publicuser, uiuser
                write list = publicuser, uiuserrest

[UI]
                comment = UI
                path = /home/samba/UI
                valid user = publicuser, uiuser
                write list = uiuser

                create mask = 0700                # 指明新創建的文件的屬性
                directory mask = 0700            # 指明新創建的目錄的屬性

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

建立服務器目錄,配置目錄屬主和權限;

目錄權限問題影響很大,目錄屬主也有很大的影響;

 

systemctl restart smb

systemctl stop smb

 

鏈接測試

Linux: smbclient -L localhost -U username@passwd

Windows:  \\localhost\

 

 

配置文件詳情可參考

          http://blog.sina.com.cn/s/blog_545f2b4701010t8i.html

          http://www.lai18.com/content/7033193.html

          http://www.cnblogs.com/mchina/archive/2012/12/18/2816717.html

          http://www.centoscn.com/CentosServer/ftp/2015/0622/5707.html

相關文章
相關標籤/搜索