快速配置 Samba 将 Linux 目錄映射為 Windows 驅動器
- 一、區域網路内的 Linux 伺服器上操作步驟:
- 二、區域網路内的 Windows 伺服器上操作步驟:
一、區域網路内的 Linux 伺服器上操作步驟:
1、安裝samba(CentOS Linux):
yum install samba system-config-samba samba-client samba-common
2、建立www賬号
/usr/sbin/groupadd www
/usr/sbin/useradd -g www www
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
輸入以下内容:
[global]
server string = Samba Server
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
[web]
path = /usr/local/lua_script
valid users= www
read only =no
public = yes
browseable = yes
writeable = yes
oplocks = no
level2 oplocks = no
~
4、為samba使用者root設立一個密碼:
smbpasswd -a www
5、添加目錄權限
chmod 777 /usr/local/lua_script
6、啟動samba:
/sbin/service smb start
7、關閉selinux
setenforce 0
sed -i 's/SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
二、區域網路内的 Windows 伺服器上操作步驟:
1、Windows 上通路 samba,在“我的電腦”中輸入:
\\192.168.88.1\
2、Windows 斷開 samba 共享連接配接,在【開始】→【運作】→【cmd】回車中輸入:
net use * /del