首頁 > 軟體

CentOS搭建Samba 實現虛擬機器與本機檔案共用

2020-06-16 17:17:58

本次是在CentOS環境,如果是Ubuntu請用apt-get,簡單明瞭,自己成功搭建執行。實現虛擬機器與本機檔案共用。

1、安裝samba

yum install samba system-config-samba samba-client samba-common

2、建立www賬號

/usr/sbin/groupadd www
/usr/sbin/useradd -g www www
mkdir -p /data0/knose/
chmod 777 /data0/knose/
mkdir -p /data0/htdocs/
chown -R www:www /data0/htdocs/
chmod 777 /data0/htdocs/
cat /etc/passwd | mksmbpasswd.sh> /etc/samba/smbpasswd

3、建立samba組態檔

mv -f /etc/samba/smb.conf /etc/samba/smb.conf.bak
vi /etc/samba/smb.conf

4、設定

[global]
server string = Samba Server
security = user
encrypt passwords = yes 
smb passwd file = /etc/samba/smbpasswd

[knose]
workgroup = root
netbios name = root
path = /data0/knose
browseable = yes
writeable = yes

[web] 
workgroup = www
netbios name = www
path = /data0/htdocs
browseable = yes
writeable = yes

5、為samba使用者www、root設立一個密碼:

smbpasswd -a www
smbpasswd -a root

6、啟動samba :

/sbin/service smb start

7.Windows設定

 

 

------------------------------------分割線------------------------------------

CentOS 7.2 安裝設定Samba伺服器  http://www.linuxidc.com/Linux/2017-03/141390.htm

VMWare 虛擬機器 Ubuntu 雙網絡卡 存取 samba 速度 翻倍 http://www.linuxidc.com/Linux/2013-06/85445.htm

Ubuntu 15.04安裝Samba服務 http://www.linuxidc.com/Linux/2016-03/129201.htm

samba安裝使用圖解  http://www.linuxidc.com/Linux/2017-03/141254.htm

CentOS 7.2 安裝設定Samba伺服器 http://www.linuxidc.com/Linux/2017-03/141390.htm

CentOS部署Samba企業檔案共用服務 http://www.linuxidc.com/Linux/2016-06/132609.htm

Samba共用伺服器的搭建優化  http://www.linuxidc.com/Linux/2017-03/141700.htm

CentOS 6.7下 Samba伺服器的搭建與設定(share共用模式)  http://www.linuxidc.com/Linux/2016-12/138220.htm

Ubuntu 16.04下Samba相關設定  http://www.linuxidc.com/Linux/2016-12/138498.htm

------------------------------------分割線------------------------------------


IT145.com E-mail:sddin#qq.com