快速配置 Samba 将 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
/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
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,在“我的电脑”中输入:
2、Windows 断开 samba 共享连接,在【开始】→【运行】→【cmd】回车中输入:
net use * /del