红联Linux门户
Linux帮助

请教:局域网中的 FC9 如何 访问 XP共享文件

发布时间:2008-10-19 22:47:19来源:红联作者:makeinstall
1: 两台电脑 PC1──XP( IP: 192.168.1.2), PC2──FC9。如何让PC2访问(可以拷贝,删除)PC1的共享文件?

2: PC2已安装samba. 但不知如何配置samba呢?如何设置PC2的局域网IP?
这里是在系统──>网络里设的PC2的局域网IP为:192.168.1.3 。用ping 192.168.1.2 是通的。

找了很久但没找到相关的文章,因为有的文章所说的 /etc/samba/smb.conf 的配置与FC9的不一样。

已作的设置:
1:在系统──>管理──>samba:添加共享──>/share文件夹

2: [root@localhost 桌面]# /etc/init.d/smb start
启动 SMB 服务: [确定]
(1)启动动samba后PC1(XP)网上邻居可以找到PC2(FC(9)。但不能访问。
(2)PC2 (FC9) 如何访问 PC1 (xp) ? 我试用 smbmount 时 shll 提示找不到这个命令 ?

以下是PC2的 /etc/samba/smb.conf:


#======================= Global Settings =====================================

[global]

# ----------------------- Netwrok Related Options -------------------------

# specifiy it as a per share option as well
#
workgroup = PC
server string = Samba Server LinuxPC

; netbios name = MYSERVER

; interfaces = lo eth0 192.168.1.2/24 192.168.1.3/24 (#这行原文档不是这样的。是我改的。)
; hosts allow =192.168.1.2 192.168.1.3

# --------------------------- Logging Options -----------------------------

# Max Log Size let you specify the max size log files should reach

# logs split per machine
log file = /var/log/samba/log.%m
# max 50KB per log file, then rotate
max log size = 50

# ----------------------- Standalone Server Options ------------------------

# compatibility. tdbsam requires no further configuration.

security = user
passdb backend = tdbsam


# ----------------------- Domain Members Options ------------------------
# password server = *


; realm = MY_REALM

; password server =

# ----------------------- Domain Controller Options ------------------------
# machine to add or delete corresponding unix accounts
#

; domain master = yes
; domain logons = yes

# the login script name depends on the machine name
; logon script = %m.bat
# the login script name depends on the unix user used
; logon script = %u.bat
; logon path = \\%L\Profiles\%u
# disables profiles support by specifing an empty path
; logon path =

; add user script = /usr/sbin/useradd "%u" -n -g users
; add group script = /usr/sbin/groupadd "%g"
; add machine script = /usr/sbin/useradd -n -c "Workstation (%u)" -M -d /nohome -s /bin/false "%u"
; delete user script = /usr/sbin/userdel "%u"
; delete user from group script = /usr/sbin/userdel "%u" "%g"
; delete group script = /usr/sbin/groupdel "%g"


# ----------------------- Browser Control Options ----------------------------
# and gives it a slightly higher chance of winning the election
; local master = no
; os level = 33
; preferred master = yes

#----------------------------- Name Resolution -------------------------------
# via DNS nslookups.

; wins support = yes
; wins server = w.x.y.z
; wins proxy = yes

; dns proxy = yes

# --------------------------- Printing Options -----------------------------

; load printers = yes
cups options = raw

; printcap name = /etc/printcap
#obtain list of printers automatically on SystemV
; printcap name = lpstat
; printing = cups

# --------------------------- Filesystem Options ---------------------------
# makes them the default for all shares

; map archive = no
; map hidden = no
; map read only = no
; map system = no
username map = /etc/samba/smbusers
; store dos attributes = yes


#============================ Share Definitions ==============================

[homes]
comment = Home Directories
browseable = no
writable = yes
; valid users = %S
; valid users = MYDOMAIN\%S

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
; guest ok = no
; writable = No
printable = yes

# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
; comment = Network Logon Service
; path = /var/lib/samba/netlogon
; guest ok = yes
; writable = no
; share modes = no


# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
; [Profiles]
; path = /var/lib/samba/profiles
; browseable = no
; guest ok = yes


# A publicly accessible directory, but read only, except for people in
# the "staff" group
; [public]
; comment = Public Stuff
; path = /home/samba
; public = yes
; writable = yes
; printable = no
; write list = +staff

[sambafile]
comment = $file
path = /opt/sambafile
writeable = yes
; browseable = yes
guest ok = yes

[ 本帖最后由 makeinstall 于 2008-10-20 21:58 编辑 ]
文章评论

共有 13 条评论

  1. makeinstall 于 2008-10-26 22:45:11发表:

    最近没空,反正这个也不是很急先放放吧,等有空再搞。要是 zjtaurus 兄你搞好了请告知一下 :-) 要是我搞好了会回复在这的。

    位置---网络----(显示有)windowns网络。可是双击windowns网络弹出的对话框是空白的。

    用 mount 命令也不行。

    不知如何弄了。看贴看得头到大了~ 也没找到个简单明了的贴~

    有空再搞搞啦 ~

    [ 本帖最后由 makeinstall 于 2008-11-8 14:35 编辑 ]

  2. zjtaurus 于 2008-10-22 12:51:57发表:

    还有“位置”-“连接到服务器”如果是错误提示的话
    请查看下你的nmb服务是不是打开的?
    如果不打开nmb服务器的话,只能通过IP来访问
    nmb是解析用的,就是把这台Linux机器所共享的工作组及在此工作组下的netbios name解析出来

  3. zjtaurus 于 2008-10-22 11:47:31发表:

    # mount -t cifs //192.168.1.2/D (D:) /mnt/d -o username=guest%3204

    D (D:),这处填XP下共享的文件名字,比如说我共享的似乎BT,所以是/BT (你直接把D盘共享了?,如果是,不要出现括号)
    /mnt/d 就是挂在后linux下的路径
    username=用户名%密码 -此处的用户名和密码都是XP下的(你的guest帐号的密码,不会也刚好是3204哇..)

    [ 本帖最后由 zjtaurus 于 2008-10-22 12:01 编辑 ]

  4. makeinstall 于 2008-10-22 00:09:48发表:

    (1)我把smbconf改成和你的一样后,XP找不到linux 了。
    但是 ping 192.168.1.2
    PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
    64 bytes from 192.168.1.2: icmp_seq=1 ttl=128 time=0.271 ms
    64 bytes from 192.168.1.2: icmp_seq=2 ttl=128 time=0.317 ms
    64 bytes from 192.168.1.2: icmp_seq=3 ttl=128 time=0.322 ms
    64 bytes from 192.168.1.2: icmp_seq=4 ttl=128 time=0.323 ms
    应该是通的。
    (2)# mount -t cifs //192.168.1.2/D (D:) /mnt/d username=guest%3204
    bash: syntax error near unexpected token `('
    不知是什么意思,好像是什么错了。
    (3)“位置”→“连接到服务器”也是错误提示。
    (4)改回 interfaces = lo eth0 192.168.1.2/24 192.168.1.3/24
    hosts allow = 127. 192.168.12. 192.168.13. XP也找不到linux了
    呵~ 看来很迷惘啊

  5. zjtaurus 于 2008-10-21 23:08:53发表:

    我的情况是xp可以访问linux,linux看不到xp,我又用win 2000访问xp,同样不行(linux和2000都是在工作组下看不到xp),看来我的问题是出在XP的某些设置上

  6. zjtaurus 于 2008-10-21 23:00:04发表:

    刚才google了下,smbmount这个命令早被弃用了,现在是:
    #mount -t cifs //192.168.0.1/share /mnt/net -o username=username%password

    [color=Black]然后我尝试了下:
    # mount -t cifs //192.168.1.2/BT /mnt/net -o username=guest%3204
    mount: 主机关闭

    看来还是我的XP有问题

    [/color]

  7. zjtaurus 于 2008-10-21 22:24:59发表:

    我的xp、linux的IP分别设置得和你完全一样
    但是最终反映到smb.conf上的时候 就是我给你看的那2行,不是我们平时熟悉的IP格式,这个先不管,你可以尝试改得和我一样

    至于smbmount,我没用过,刚试了,也和你一样
    如果你要尝试连接XP
    “位置”→“连接到服务器”看看

  8. makeinstall 于 2008-10-21 21:40:46发表:

    ; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24 -2处和你的略有不同
    ; hosts allow = 127. 192.168.12. 192.168.13.

    这两处原smb.conf也是这样的我改成:
    ; interfaces = lo eth0 192.168.1.2/24 192.168.1.3/24 (#这行原文档不是这样的。是我改的。)
    ; hosts allow =192.168.1.2 192.168.1.3 (#这行原文档不是这样的。是我改的。)
    这样的。
    因为XP我设的IP是:192.168.1.2。linux我在网络处设的IP是:192.168.1.3。所以我把 interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24 和hosts allow = 127. 192.168.12. 192.168.13. 改了(不太清楚在哪里如何设linux的局域网IP)。因为我怎么看总觉得interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24 与设置的192.168.1.2和192.168.1.3不同;hosts allow = 127. 192.168.12. 192.168.13.不像是IP格式呀。

    另:请教为何我用 smbmount 192.168.1.2 时终端提示: Unknown command 'smbmount' ?

    [ 本帖最后由 makeinstall 于 2008-10-21 21:47 编辑 ]

  9. zjtaurus 于 2008-10-21 20:49:05发表:

    我把我的截取给你看下,我的情况是XP(192.168.1.2)可以访问linux(192.168.1.3)的资源,反之则不行
    workgroup = 321home -这个是工作组,要和XP统一
    server string = Samba Server
    ; netbios name = MYSERVER

    ; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24 -2处和你的略有不同
    ; hosts allow = 127. 192.168.12. 192.168.13.

  10. makeinstall 于 2008-10-21 20:06:58发表:

    1: 两台电脑 PC1──XP( IP: 192.168.1.2), PC2──FC9。如何让PC2访问(可以拷贝,删除)PC1的共享文件?

    2: PC2已安装samba. 但不知如何配置samba呢?如何设置PC2的局域网IP?
    这里是在系统──>网络里设的PC2的局域网IP为:192.168.1.3 。用ping 192.168.1.2 是通的。

    找了很久但没找到相关的文章,因为有的文章所说的 /etc/samba/smb.conf 的配置与FC9的不一样。

    已作的设置:
    1:在系统──>管理──>samba:添加共享──>/share文件夹

    2: [root@localhost 桌面]# /etc/init.d/smb start
    启动 SMB 服务: [确定]
    (1)启动动samba后PC1(XP)网上邻居可以找到PC2(FC(9)。但不能访问。
    (2)PC2 (FC9) 如何访问 PC1 (xp) ? 我试用 smbmount 时 shll 提示找不到这个命令 ?


    上面有完整的PC2的 /etc/samba/smb.conf。

    下面的IP不知设得对不对?

    #======================= Global Settings =====================================

    [global]

    # ----------------------- Netwrok Related Options -------------------------

    # specifiy it as a per share option as well
    #
    workgroup = PC
    server string = Samba Server LinuxPC

    ; netbios name = MYSERVER

    ; interfaces = lo eth0 192.168.1.2/24 192.168.1.3/24 (#这行原文档不是这样的。是我改的。)
    ; hosts allow =192.168.1.2 192.168.1.3


    [ 本帖最后由 makeinstall 于 2008-10-21 20:08 编辑 ]

  11. zjtaurus 于 2008-10-21 00:00:33发表:

    要让linux访问到xp
    有时候不是你linux设置的问题
    是xp的问题
    如果有在寝室用郭局域网就有体会
    XP有时候互访都不行
    查看下你的XP的设置吧
    比如说防火墙的

  12. makeinstall 于 2008-10-20 21:42:00发表:

    我的目的只想让PC2(linux)访问PC1(xp). PC1能不能访问PC2我并不是很关心。

    其实,很多文档都是说如何让PC2(linux)主机作为服务器使用。可是我并不想这么用。我的目的只想让PC2(linux)访问PC1(xp). PC1能不能访问PC2我并不是很关心。当然我还希望有时PC2能通过PC1共享上网。

  13. zjtaurus 于 2008-10-20 02:44:22发表:

    先把selinux关了

    在samba的'服务器设置"中的安全选项卡下:
    验证模式:用户
    加密密码:是
    来宾用户:(随便你选个)

    随后确定/opt/sambafile的权限是不是够
    最后图形化界面下,直接点击访问不起
    试试在XP下用\\192.1681.X这种形式访问