我的smb.conf配置文件
[global]
workgroup=MSHOME
netbios name=sambaserver
Server string=This is test server
unix charset=utf8
display charset=utf8
dos charset=cp936
log file=/var/log/samba/%m.log
max log size=50
security=share
socket options=TCP_NODELAY SO_REVBUF=8192 SO_SEDBUF=8192
dns proxy=no
template shell=/bin/false
winbind use default domain=no
[temp]
comment=Temporary file space
path=/tmp
read only=no
public=yes
[test]
comment=test share file created by myself
path=/test
read only=no
public=yes
我用windows 访问 \\192.168.3.100时,我可以正常操作temp文件夹下的东西
但我点击test文件夹时就弹出权限不够
我用chmod a+rwx,o+t test 修改test的权限和/tmp一样
点击test还是进不去,为什么
球高手指点。。谢谢
chen163 于 2010-01-02 00:07:13发表:
[root@localhost root]# rpm -qa|grep samba
//查看samba是否的安装
samba-2.2.7a-7.9.0
redhat-config-samba-1.0.4-1
samba-common-2.2.7a-7.9.0
samba-client-2.2.7a-7.9.0
[root@localhost root]# service smb start
//启动samba服务
启动 SMB 服务: [ 确定 ]
启动 NMB 服务: [ 确定 ]
[root@localhost root]# pgrep smbd
//查看smb服务器是否运行
2709
[root@localhost root]# pgrep nmbd
//查看nmb是否运行,如果没有运行,查看ip,子网掩码是否配置
[root@localhost root]# ifconfig
//没有配置linux的ip,子网掩码,接下来配置ip,子网掩码。ip与windows xp时同一网段的,子网掩码相同
eth0 Link encap:Ethernet HWaddr 00:0C:29:64:79:7C
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:93 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:9592 (9.3 Kb) TX bytes:5472 (5.3 Kb)
Interrupt:10 Base address:0x2024
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:7505 errors:0 dropped:0 overruns:0 frame:0
TX packets:7505 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:512783 (500.7 Kb) TX bytes:512783 (500.7 Kb)
[root@localhost root]# ifconfig eth0 172.19.23.11 netmask 255.255.254.0
[root@localhost root]#ping -c 4 172.19.23.21
//ping一下windows xp的ip地址看是否能ping通,ping通说明网络联通
PING 172.19.23.21 (172.19.23.21) 56(84) bytes of data.
64 bytes from 172.19.23.21: icmp_seq=1 ttl=64 time=0.823 ms
64 bytes from 172.19.23.21: icmp_seq=2 ttl=64 time=0.161 ms
64 bytes from 172.19.23.21: icmp_seq=3 ttl=64 time=0.137 ms
64 bytes from 172.19.23.21: icmp_seq=4 ttl=64 time=0.111 ms
--- 172.19.23.21 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 0.111/0.308/0.823/0.297 ms
[root@localhost root]# netstat -tlnp|grep smb
//查看smb所占用的端口,smb端口为139
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN
2709/smbd
[root@localhost root]# iptables -F
//清除防火墙规则
[root@localhost root]# cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
//备份samba的配置文件,以防万一
[root@localhost root]# vi /etc/samba/smb.conf
//编辑smb文件找到security=user,将其给为security=share
按ESC
:wq
保存退出
[root@localhost root]# service smb restart
//重启samba服务器,使配置文件生效
关闭 SMB 服务: [ 确定 ]
关闭 NMB 服务: [ 确定 ]
启动 SMB 服务: [ 确定 ]
启动 NMB 服务: [ 确定 ]
[root@localhost root]# mkdir /mnt/text
//在/mnt目录下建一个子目录text
[root@localhost root]# chmod 0777 /mnt/text
//给子文件text,用户、组、其他用户执行、读写的权限
[root@localhost root]# vi + /etc/samba/smb.conf
//编辑smb.conf配置文件,光标处在文件的末尾,添加系列内容
#This is samba text // 注释说明
[text] //共享目录的名字
comment=text
path=/mnt/text //共享目录路径
read only=no //指定目录是否可读
writable=yes //指定目录是否可行
public=yes //指定目录是否可以guest访问
//按ESC
:wq
//保存退出
[root @localhost root]#service smb restart
//重启samba服务
关闭 SMB 服务: [ 确定 ]
关闭 NMB 服务: [ 确定 ]
启动 SMB 服务: [ 确定 ]
启动 NMB 服务: [ 确定 ]
//最后在windows xp的IE地址栏输入:samba的服务器的地址,就会访问到text共享文件夹
chen163 于 2010-01-01 18:08:27发表:
发错了
修改samba的配置文件 /etc/samba/smb.conf
[root @localhost root]#vi /etc/samba/smb.conf
找到
security=user
将其给为
security=share
按ESC
:wq
保持退出
[root @localhost root]#service smb restart
重启smb服务
这样访问不要密码的
chen163 于 2010-01-01 17:15:42发表:
linux共享windows xp,首先要安装VMware workstration虚拟机,启动虚拟机。
打开linux系统终端,查看是否安装sabma服务。用rpm -qa|grep samba
如果没有安装,“主菜单”--“系统设置”--“添加/删除应用程序”--“打开软件包”--“windows 文件服务器”--“更新”
启动samba服务,主菜单--系统设置--服务器设置--服务--在smb前打勾--开始
启动samba服务,serviece smb start
查看IP的配置ifconfig
查看windows xp的IP配置
IP:172.19.23.21
网关:255.255.254.0
回到linux中,配置linux IP
[root @ localhost root]#ifconfig eth0 172.19.23.11 netmask 255.255.254.0
ping网络是否通畅,ping -c 4 172.19.23.21
[root @ localhost root]#ping -c 4 172.19.23.21
启动samba服务:service smb start
重启samba服务:service smb restart
查看samba服务是否启动:pstree |grep mbd
查看samba服务器的运行状况:pgrep smbd
有时你的防火墙可能会把smbd服务器的端口封掉,所以我们应该打开smbd服务器所占用的端口,139和445
查看samba服务器的端口及防火墙:netstat -tlnp|grep smb
如果不知道怎么打开,可能你和我一样市新手,还是把防火墙规则清除掉也行
#iptables -F
或
#/sbin/iptables -F
现在我们开始在linux下借助于smbmount命令来实现网络驱动器映射,具体命令是:
smbmount //windowsHostName/ShareName /mnt/smbdir -U administrator
说明:此处的sharename指代windows共享目录名称,smbdir指代挂载点名称,U指代登陆windows系统的用户名,administrator指代登陆windows主机下的共享文件夹a映射为/mnt/winshare.目录,具体步骤是:
在实现网络驱动映射前,首先在linux下建个文件夹:mkdir /mnt/windows
在终端命令窗口,运行:smbmount //172.19.23.21/a /mnt/windows -U administrator
回车
则进入系统,系统会要求输入用户密码,此时输入windows系统的密码,回车。如果windows没有密码直接回车
niupijieke 于 2009-12-23 21:55:16发表:
好多SELINUX有关了
qing_dc 于 2009-12-23 13:36:59发表:
跟SELinux有关
bingwzi 于 2009-12-22 22:18:30发表:
直接吧selinux关掉就可以了
wolf_life1 于 2009-12-15 09:30:42发表:
2# bobo504
谢谢,我刚接触linux,是菜鸟级别,对Linux不是很熟悉,架设samba,没有好好看英文注释(英文不是很好),谢谢你的指点,,。
Fallsare 于 2009-12-15 00:01:33发表:
顶沙发
bobo504 于 2009-12-14 23:29:58发表:
是否开启了selinux,用getenforce看看是enforcing还是disable,如果是enforcing,ls -ldZ /test看一下安全上下文是不是samba共享类型,不是的话就运行一下chcon -t samba_share_t /test,改变你的test目录安全上下文,否则你改成777也照样会在samba服务访问时被selinux禁掉
其实smb.conf最上面就有注释,关于selinux下的相关设置,如何开启用户个人目录、开启自己建立的目录、开启系统建立的目录访问权限的设置方法