文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>在ubuntu上用samba放硬盘游戏

在ubuntu上用samba放硬盘游戏

时间:2007-02-03  来源:gydoesit

在ubuntu上用samba放硬盘游戏 打算在ubuntu6.10上存放网吧的硬盘游戏,因为这种游戏基本不用升级,好管理 先安装samba
root@www:/www# apt-get install samba
在后面的一些失败的提示,不知有没有影响
Setting up samba (3.0.22-1ubuntu4) ...
Generating /etc/default/samba...
TDBSAM version too old (0), trying to convert it.
TDBSAM converted successfully.
account_policy_get: tdb_fetch_uint32 failed for field 1 (min password length), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 2 (password history), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 3 (user must logon to change password), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 4 (maximum password age), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 5 (minimum password age), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 6 (lockout duration), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 7 (reset count minutes), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 8 (bad lockout attempt), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 9 (disconnect time), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 10 (refuse machine password change), returning 0
安装smbclient和smbfs,不装也没关系
root@www:/var/log/samba# apt-get install smbclient
root@www:/var/log/samba# apt-get install smbfs
建立目录,增加一个win用户用于管理共享文件
root@www:/etc/samba# mkdir /www/win/
root@www:/etc/samba# mkdir /www/win/game
root@www:/etc/samba# useradd -d /www/win win
root@www:/etc/samba# chmod -R 777 /www/win/
root@www:/etc/samba# passwd win
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
如果需要复杂的权限控制,可以启用ACL
root@www:/etc/samba# apt-install acl
root@www:/etc/samba# getfacl smb.conf
# file: smb.conf
# owner: root
# group: root
user::rw-
group::r--
other::r--
ubuntu 6.10安装时选了简体中文却并不能正常显示和输入中文,因为/root/.profile中有
LANG=C
LANGUAGE=C
这两句,所以需要去掉或者把文件改名,再查看locale
root@www:~# locale
LANG=zh_CN.UTF-8
LANGUAGE=zh_CN:zh
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=
这样就能正常处理中文了

于是编辑smb.conf,记得先备份原来的设置文件
root@www:/www# cd /etc/samba
root@www:/etc/samba# cp smb.conf smb.conf.bak
root@www:/www# vim /etc/samba/smb.conf
设定以下内容: [global]
#windows计算机看到的网上邻居名称
netbios name = GAME
#服务器描述,可不要。%v是samba的版本号
server string = samba %v on  ubuntu 6.10
#windows工作组名,默认是MSHOME,windows是默认为WORKGROUP
workgroup = WORKGROUP
#在本应用中,用share方式就能满足要求,这样客户可不要密码访问
#如果用user方式,为免密码不对不能访问,可以用map to guest=Bad User
#这样所有密码不对的用户都会被当作guest
security = SHARE
#windows时间服务器,可不用
time server = Yes
#是否参加主浏览器选取,默认是yes,如果需要保证成主浏览器,还需设置os level = 65
local master = No
#拒绝存取的文件,比如病毒生成的文件,在windows上无法写入也无法读取,看不到
veto files = /Desktop__.ini/Desktop_.ini/_desktop.ini/
#相当于dos filemode,可以删除只读文件
delete readonly = Yes
#模拟windows处理文件时间的方式,对文件时间取整处理
dos filetime resolution = Yes
#模拟windows处理目录建立时间的方式
fake directory create times = Yes
#下面是自定义资源 
[游戏]
#共享的描述
comment = game
path = /www/win/game
read only = No
guest ok = Yes
重启samba服务
root@www:/www# /etc/init.d/samba restart
用smbclient测试
root@www:~# smbclient -L game
Password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.22]
        Sharename       Type      Comment
        ---------       ----      -------
        print$          Disk      Printer Drivers
                        Disk      game
        IPC$            IPC       IPC Service (samba 3.0.22 on  ubuntu 6.10)
        ADMIN$          IPC       IPC Service (samba 3.0.22 on  ubuntu 6.10)
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.22]
        Server               Comment
        ---------            -------
        GAME                 samba 3.0.22 on  ubuntu 6.10
        NETBAR
        Workgroup            Master
        ---------            -------
        WORKGROUP
测试和查看配置文件用testparm,加参数v可以看默认设置,用smbstatus可以看当前连接及使用状态 如需要图形化管理samba,可以安装swat
root@www:~# apt-get install swat
因为swat基于inetd启动,所以还要安装inetd
root@www:~# apt-get install inetd
安装时会自动用inetutils-inetd代替inetd
root@www:~# cat /etc/inetd.conf
#<off># netbios-ssn     stream  tcp     nowait  root    /usr/sbin/tcpd  /usr/sbin/smbd
swat            stream  tcp     nowait.400      root    /usr/sbin/tcpd  /usr/sbin/swat
可以一并下载rcconf以便管理启动服务
root@www:~# apt-get install rcconf
通过浏览器访问 http://ip:901/ 就可以用swat了 上传游戏时,推荐用开源程序filezilla,字符集一定要选强制UTF8,这样windows和linux都能正常显示中文。硬盘游戏因为不升级,所以只需 要把存进度的和有些配置文件放开权限就行了,这要通过观察得知是哪些目录和文件需要。并不是所有要写的文件都要放开,比如《三角力量 》的cfg文件,可能会按键设乱。 ftp上传的文件创建和修改时间都是当前的时间.对硬盘游戏来说也无所谓,不存在某些网络游戏自检的问题。 samba在默认dos filetime resolution = no 时,有些文件修改时间会和windows差一秒,但是改成yes时,似乎另一些文件又差。而且看来时 间已经一样了,游戏更新的对比软件还是要同步,不知为什么。所以暂不用来放网络游戏的更新文件。网络游戏的权限和管理还是麻烦事,现 在先不考虑。        
 
相关阅读 更多 +
排行榜 更多 +
摆个车游戏

摆个车游戏

休闲益智 下载
哈基跑酷最新版

哈基跑酷最新版

休闲益智 下载
冷血射手最新版

冷血射手最新版

休闲益智 下载