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

用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的不行。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值