我的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
服务也都启动了,
奇怪的是我在window上访问Linux 共享文件时,可以看到temp和test两个目录,但是我只能点temp文件夹。但点击test文件夹就说权限问题,没有权限
但我在Linux里,通过chmod a+rwx,o+t /test
用ls -al 看到/test和/tmp他们的权限都一样。
为什么在window上访问不了呢。。
求救啊。。谢谢高手指点,我还是菜鸟。
chen163 于 2010-01-02 00:10:29发表:
[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 17:12:33发表:
vi /etc/samba/smb.conf
找到
security=user
将user改为share
然后可以挂在了
sabmount //windowshostname/sharename /路径/linuxsharename -U administrator