最小代安装freebsd后,设置好网络环境
1.新建game文件夹
mkdir /usr/game
cd /usr/game --进入game目录
2.下载samba源代码
ftp 192.168.0.200 --登陆FTP
bin --转换二进制模式
get samba-3.0.23d.tar.gz --使用get命令下载文件
exit
3.解压并安装samba
tar zxvf samba-3.0.23d.tar.gz
cd samba-3.0.23d
cd source
./configure --prefix=/usr/local/samba 默认安装目录
make
make install
cd ..
cd examples
4.在系统内添加两个测试帐号,接着将他们加入到samba帐号里面并设置samba帐号 (重点)
adduser --添加系统账号 jerry , administrator
Username:jerry --更新游戏账号
Enter password:
Enter password again:
adduser
Username:administrator --客户机账号
Enter password:
Enter password again:
将 jerry , administrator 加入到samba帐号里面并设置samba帐号
usr/local/samba/bin/smbpasswd -a jerry
New SMB password: -- 一定要和系统密码相同
Retype new SMB password:
usr/local/samba/bin/smbpasswd -a administrator
New SMB password: -- 一定要和系统密码相同
Retype new SMB password:
#=Global Settings =
[global]
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
workgroup = workgroup
# server string is the equivalent of the NT Description field
server string = Samba Server
# Security mode. Defines in which mode Samba will operate. Possible
# values are share, user, server, domain and ads. Most people will want
# user level security. See the Samba-HOWTO-Collection for details.
security = user
#=Share Definitions =
[game]
path = /usr/game ;游戏目录(客户机,使用administrator,只读权限)
valid user = administrator ;只允许administrator访问,
browseable = no ;不显示共享目录
[up]
comment = up ;共享名称,必须加,不然会找不到目录(游戏更新专用,jerry,可读/写权限)
path = /usr/game ;游戏更新目录
write list = jerry ;只允许jerry修改
invalid users = administrator ;禁止administrator访问
browseable = no ;不显示共享目录
6.建立一个启动脚本让系统启动的时候让samba服务也一起启动
ee /etc/rc.d/samba.sh
/usr/local/samba/sbin/smbd start &
/usr/local/samba/sbin/nmbd start &
保存退出
7.设置/usr/game文件夹权限
chmod 777 /usr/game (重要,不然无法写入文件)
(重启生效)