Chinaunix首页 | 论坛 | 博客
  • 博客访问: 386955
  • 博文数量: 109
  • 博客积分: 5045
  • 博客等级: 大校
  • 技术积分: 1199
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-08 14:47
文章分类

全部博文(109)

文章存档

2017年(1)

2012年(5)

2011年(10)

2010年(1)

2009年(13)

2008年(29)

2007年(6)

2006年(44)

我的朋友

分类: LINUX

2008-04-25 21:23:40

用samba解决linux与windows的局域网共享问题

之前系统曾用过这种方式的共享,所以留下了一些痕迹,以至于对现在的配置还会有所影响。

根据《The Unofficial Samba HOWTO》


这里有一些相关命令:

Once you’ve installed Samba, you should become at least somewhat aware of a few of the tools at your disposal:

* findsmb - list info about machines that respond to SMB name queries on a subnet

* make_unicodemap - construct a unicode map file for Samba

* make_smbcodepage - construct a codepage file for Samba

* nmbd - NetBIOS name server to provide NetBIOS over IP naming services to clients

* nmblookup - NetBIOS over TCP/IP client used to lookup NetBIOS names

* rpcclient - Tool for executing client side MS-RPC functions

* smbcacls - Set or get ACLs on an NT file or directory names

* smbclient - ftp-like client to access SMB/CIFS resources on servers

* smbcontrol - Send messages to smbd, nmbd or winbindd processes

* smbd - Server to provide SMB/CIFS services to clients

* smbmnt - Helper utility for mounting SMB filesystems

* smbmount - Mount an smbfs filesystem

* smbpasswd - Change or create a user’s SMB password

* smbspool - Send a print file to an SMB printer

* smbstatus - Report on current Samba connections

* smbtar - Shell script for backing up SMB/CIFS shares directly to UNIX tape drives

* testparm - Check an smb.conf configuration file’s syntax

* testprns - Check printer name for validity with smbd

* wbinfo - Query information from winbind daemon

* winbindd - Name Service Switch daemon for resolving names from NT servers



这里所用到了以下命令:

If you really just want to restart Samba (thus having it re-read its configuration files), you can just send a SIGHUP signal:

# killall -HUP smbd nmbd
修改了samba的配置文件:/etc/samba/smb.conf

# This is /etc/samba/smb.conf

[global]
guest account = smbguest
log file = /var/log/samba.log
log level = 1
netbios name = FLUFFYGERBIL //////been changed
security = share
socket options = TCP_NODELAY IPTOS_LOWDELAY
workgroup = WORKGROUP //////been changed
[public] //////been changed
guest ok = yes
guest only = yes
path = /tmp //////been changed
read only = no

[cdrom] /////been deleted
fake oplocks = yes
guest ok = yes
guest only = yes
path = /mnt/cdrom
read only = yes
这个文件里的内容可以用testparm显示。

Next, we’ll need to set up a generic guest account in the system itself. While the commands can be somewhat system dependent, you can typically do this with something similar to:

# groupadd smbguest
# useradd -g smbguest -d /dev/null -s /bin/false smbguest

每次修改完smb.conf需要重新运行一下

# killall -HUP smbd nmbd

以便使其生效。

之后的问题就是,在path中提供的目录的权限问题,如果权限设置不恰当,也是没有办法访问的。

比较奇怪的是,有一个组为root的文件夹及里面的文件是可以访问的。而组为users的不行。



阅读(1665) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~