- 工信部備案號 滇ICP備05000110號-1
- 滇公安備案 滇53010302000111
- 增值電信業(yè)務經(jīng)營許可證 B1.B2-20181647、滇B1.B2-20190004
- 云南互聯(lián)網(wǎng)協(xié)會理事單位
- 安全聯(lián)盟認證網(wǎng)站身份V標記
- 域名注冊服務機構(gòu)許可:滇D3-20230001
- 代理域名注冊服務機構(gòu):新網(wǎng)數(shù)碼
一、CentOS7安裝samba,用于在Linux系統(tǒng)上實現(xiàn)SMB協(xié)議的軟件
在終端運行命令
yum install samba
二、創(chuàng)建準備分享的文件夾
在根目錄下建立/gongxiang(自定義)子目錄,創(chuàng)建文件test.txt,并修改其權(quán)限為可讀可寫(777)
1.創(chuàng)建共享的文件夾gongxiang
[root@hadoop100 /]# mkdir /gongxiang
2.創(chuàng)建文件test.txt
[root@hadoop100 gongxiang]# Touch test.txt
3.修改目錄權(quán)限
[root@hadoop100 /]# chmod -R 777 gongxiang
三、修改samba配置文件
CentOS7中,samba配置文件在/etc/samba/smb.conf
1. 進入配置文件,修改配置文件
[root@hadoop100 samba]# Vi /etc/samba/smb.conf
2. 添加如下配置
[gongxiang]
comment = my share files
path = /gongxiang
writable = yes
public = yes
3.檢查配置文件是否正確
[root@hadoop100 samba]# testparm
四、添加系統(tǒng)用戶及samba用戶
1.添加系統(tǒng)用戶
[root@hadoop100 samba]# useradd xr
2.查看系統(tǒng)用戶是否添加成功
[root@hadoop100 samba]# cat /etc/passwd
3.添加samba用戶
[root@hadoop100 samba]# smbpasswd -a xr
五、關(guān)閉SELinux服務以及防火墻
1.關(guān)閉防火墻
[root@hadoop100 samba]# systemctl stop firewalld
2.關(guān)閉SELinux服務
[root@hadoop100 samba]#Setenforce 0
六、重新啟動smb和nmb服務
[root@hadoop100 samba]# systemctl restart smb
[root@hadoop100 samba]# systemctl restart nmb
七、linux下查看該共享文件
[root@hadoop100 samba]# smbclient //192.168.10.100/gongxiang -u xr
八、Windows下查看該共享文件
ctrl+r打開運行框,輸入IP地址
便可以看到共享的文件夾gognxiang以及該文件夾內(nèi)部的文件、文件夾。
提交成功!非常感謝您的反饋,我們會繼續(xù)努力做到更好!
這條文檔是否有幫助解決問題?
售前咨詢
售后咨詢
備案咨詢
二維碼
TOP