happinessro 发表于 2004-8-6 18:28:45

如何配置smb连接局域网。

我以前安装的是redhat9,安装完以后我的两台电脑就可以看到对方了,而且也能够看到局域网上其他的电脑,但是我安装fedora1之后,就不能看到其他的电脑了,就连自己的两台电脑都不能看见了.点击 主菜单\网络服务器\ 就会提示
因为 Nautilus 无法联系 SMB 主浏览器,所有无法显示“smb:///”。
请检查并确定局域网内有正在运行的 SMB 服务器。

可是我在系统设置\服务器设置\服务 中已经激活了samba啊,真的是很郁闷.现在每次两台电脑要共享什么资料都要回到windows系统,很烦人,
1.不知道有没有兄弟能帮我解决这个问题,
2.还有就是如果要访问局域网,要起动哪些服务.
小弟在这里先谢谢了.

linky_fan 发表于 2004-8-6 18:37:28

那么依赖windows干嘛,linux下面有nfs,nis和ftp,共享资料这事不是小菜一叠.samba没起来的原因估计是配置文件有点问题,配置文件在/etc底下,看一下好了

GGGO 发表于 2004-8-6 18:37:36

不但要运行samba,还要配置samba。具体看网络版的置顶帖子或找samba相关的精华帖子。

happinessro 发表于 2004-8-7 12:58:35

老兄,我已经配置了samba啊,还是不行啊.可能是我的版本低了,fedora自带的是1.*的,我看很多网站建议安装2.*,我升级以后再看看.

GGGO 发表于 2004-8-7 14:11:02

Fedora带的好象是3.x的。我用过,可以,正常。
有时“网络服务器”显示不了,你可以用smbtree和smbmount命令试试看。

happinessro 发表于 2004-8-7 17:02:33

楼上的兄弟,我用的是fedora1,你说的是2,我也用过了的,可是毛病太多了,特别是中文支持方面.所以我下载了一个1.*的版本.
按照你的方法,我输入smbtree后要我输入密码,也没有提示用什么密码,我就输入root的密码,结果什么都没有出现.
输入smbmount后出现下面的提示:
Usage: mount.smbfs service mountpoint [-o options,...]
Version 3.0.0-15

Options:
      uname=<arg>                  SMB uname
      password=<arg>                  SMB password
      credentials=<filename>          file with uname/password
      krb                           use kerberos (active directory)
      netbiosname=<arg>               source NetBIOS name
      uid=<arg>                     mount uid or uname
      gid=<arg>                     mount gid or groupname
      port=<arg>                      remote SMB port number
      fmask=<arg>                     file umask
      dmask=<arg>                     directory umask
      debug=<arg>                     debug level
      ip=<arg>                        destination host or IP address
      workgroup=<arg>               workgroup on destination
      sockopt=<arg>                   TCP socket options
      scope=<arg>                     NetBIOS scope
      iocharset=<arg>               Linux charset (iso8859-1, utf8)
      codepage=<arg>                  server codepage (cp850)
      unicode                         use unicode when communicating with server
      lfs                           large file system support
      ttl=<arg>                     dircache time to live
      guest                           don't prompt for a password
      ro                              mount read-only
      rw                              mount read-write

This command is designed to be run from within /bin/mount by giving
the option '-t smbfs'. For example:
mount -t smbfs -o uname=tridge,password=foobar //fjall/test /data/test

我是菜菜鸟,玩linux才不到一个星期,对这些参数更本不知道怎么用啊,虽然我能看懂上面的英文.但是linux的参数太多了.我都是通过图形界面配置的啊!

GGGO 发表于 2004-8-7 19:37:57

没错啊,Fedora core 1系统自带的samba是3.x的。
smbtree那个密码其实可以不用输的,直接回车就行了,因为大多数windows共享资源都是不用密码验证的。
我晚点贴出我以前的配置文件给你啊,是Fedora 1的,不知道还找不找的到 :mrgreen:

happinessro 发表于 2004-8-7 19:59:28

谢谢,我刚才才搞密明白,samba的确是3,0的,我搞错了, 我是在Samba Server Configuration Tool 1.1.4这个东东里面配置的,也就是系统带的那个图形华配置工具.但是我按照说明里面的配置配置完以后在 主菜单\网络服务器 还是提示
因为 Nautilus 无法联系 SMB 主浏览器,所有无法显示“smb:///”。
请检查并确定局域网内有正在运行的 SMB 服务器。

我也不知道怎么回事,在我的windows系统里面也不能看见我共享的/home 目录.以下是我的配置的smb.conf文件,麻烦帮我看看有没有文体,谢谢先了!!


# workgroup = NT-Domain-Name or Workgroup-Name
        workgroup = MYGROUP
# server string is the equivalent of the NT Description field
        server string = samba server
log file = /var/log/samba/%m.log
max log size = 50
# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
!!!!!!!!!
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
        username map = /etc/samba/smbusers
        password server = None
        guest ok = yes
        guest account = robin
        dns proxy = no
!!!!!!!!!
#!!!!!!之间部分我认为是可以不要的,因为我更本不是配置服务器,只是想将家里通过交换机#联接的两台电脑联网而已.然后通过局域网上网,但是这是系统默认的,我没有该

        comment = Home Directories
        browseable = yes
        writeable = yes

        path = /

happinessro 发表于 2004-8-7 20:58:56

我的配置截图,请帮忙看看那里有问题!!

/root/afterclick
这是点击 主菜单\网络服务器 之后见到的错误提示.

/root/service set1
这是我的服务器选项的基本配置.

/root/service set2
这是我的服务器选项的访问权限配置

/root/user set1
这是我的用户选项配置

/root/user set
添加完用户后看到的信息.

/root/share set1
这是共享文件目录访问权限配置.

/root/share set2
这是共享的目录.

/root/samba set1
这是配置完成后看到的信息.

其实我觉得我的配置应该是没有问题的,因为基本上我是能够看懂那些伊文里面的东西,我就是学英语的.可是我按照smb.conf和网络上大家介绍的文章配置以后依然出现图1的提示,真是郁闷的很啊,如果大侠们帮帮忙啊.

happinessro 发表于 2004-8-7 21:01:32

我的图片怎么没有上传上来了,郁闷,应该怎么上传本地硬盘的图片啊?

GGGO 发表于 2004-8-7 21:55:28

这个我也。。。。不知道 :mrgreen:
本人从来都没贴过图。
关于samba的设置,单单用Fedora自带的图形工具还不够的,具体还要改smb.conf
其实一般只要设置好工作组、ip地址、主机名、共享方式、samba用户(用share方式的话好象可以不添加samba用户)就行了。

happinessro 发表于 2004-8-7 22:02:32

哈哈,谢谢gggo兄弟(姐姐),用那个图形界面控制应该是可以的,我已经能够在我的windows系统中看到我的samba的计算机名字了,但是还是不能访问,估计是权限的问题,我正在慢慢解决,希望能早日找到解决的办法。我以前用2003的时候,权限问题也搞了我好几天的,哈哈。
我刚才在论坛的说明里面看了,好像是不能上传本地图片,正是郁闷。

GGGO 发表于 2004-8-7 23:32:25

我在这个论坛还没见过女的 :mrgreen:

GGGO 发表于 2004-8-7 23:33:05


        dos charset = cp936
        unix charset = cp936
        map to guest = Bad User
# workgroup = NT-Domain-Name or Workgroup-Name
        workgroup = china

# server string is the equivalent of the NT Description field
        server string = samba server

# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
        hosts allow = 192.168.1. 127.

# if you want to automatically load your printer list rather
# than setting them up individually then you'll need this
        printcap name = /etc/printcap
        load printers = yes

# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx
;   printing = bsd

# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
        guest account = someone

# this tells Samba to use a separate log file for each machine
# that connects
        log file = /var/log/samba/%m.log

# Put a capping on the size of the log files (in Kb).
        max log size = 50

# Security mode. Most people will want user level security. See
# security_level.txt for details.
# Use password server option only with security = server
;   password server = <NT-Server-Name>

# Password Level allows matching of _n_ characters of the password for
# all combinations of upper and lower case.
;password level = 8
;uname level = 8

# You may wish to use password encryption. Please read
# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
        smb passwd file = /etc/samba/smbpasswd

# The following are needed to allow password changing from Windows to
# update the Linux system password also.
# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
# NOTE2: You do NOT need these to allow workstations to change only
#      the encrypted SMB passwords. They allow the Unix password
#      to be kept in sync with the SMB password.
;unix password sync = Yes
;passwd program = /usr/bin/passwd %u
;passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*

# Unix users can map to different SMB User names
;uname map = /etc/samba/smbusers

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
;   include = /etc/samba/smb.conf.%m

# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
        interfaces = 192.168.1.132/24

# Configure remote browse list synchronisation here
#request announcement to, or browse list sync from:
#        a specific host or from / to a whole subnet (see below)
;   remote browse sync = 192.168.3.25 192.168.5.255
# Cause this host to announce itself to local subnets here
;   remote announce = 192.168.1.255 192.168.2.44

# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
;   local master = no

# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
;   os level = 33

# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
;   domain master = yes

# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election
;   preferred master = yes

# Enable this if you want Samba to be a domain logon server for
# Windows95 workstations.
;   domain logons = yes

# if you enable domain logons then you may want a per-machine or
# per user logon script
# run a specific logon batch file per workstation (machine)
;   logon script = %m.bat
# run a specific logon batch file per uname
;   logon script = %U.bat

# Where to store roving profiles (only for Win95 and WinNT)
#      %L substitutes for this servers netbios name, %U is uname
#      You must uncomment the share below
;   logon path = \\%L\Profiles\%U

# All NetBIOS names must be resolved to IP Addresses
# 'Name Resolve Order' allows the named resolution mechanism to be specified
# the default order is "host lmhosts wins bcast". "host" means use the unix
# system gethostbyname() function call that will use either /etc/hosts OR
# DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf
# and the /etc/resolv.conf file. "host" therefore is system configuration
# dependant. This parameter is most often of use to prevent DNS lookups
# in order to resolve NetBIOS names to IP Addresses. Use with care!
# The example below excludes use of name resolution for machines that are NOT
# on the local network segment
# - OR - are not deliberately to be known via lmhosts or via WINS.
; name resolve order = wins lmhosts bcast

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
;   wins support = yes

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
#        Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
;   wins server = w.x.y.z

# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one        WINS Server on the network. The default is NO.
;   wins proxy = yes

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
        password server = None
        username map = /etc/samba/smbusers
        guest ok = yes
        dns proxy = no

# Case Preservation can be handy - system default is _no_
# NOTE: These can be set on a per share basis
;preserve case = no
;short preserve case = no
# Default case is normally upper case for all DOS files
;default case = lower
# Be very careful with case sensitivity - it can break things!
;case sensitive = no

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

        comment = Home Directories
        browseable = no
        writeable = yes

# Un-comment the following and create the netlogon directory for Domain Logons
;
;   comment = Network Logon Service
;   path = /home/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
;
;    path = /home/profiles
;    browseable = no
;    guest ok = yes


# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer

        comment = All Printers
        path = /var/spool/samba
        browseable = no
# Set public = yes to allow user 'guest account' to print
        printable = yes

# This one is useful for people to share files
;
;   comment = Temporary file space
;   path = /tmp
;   read only = no
;   public = yes

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

# Other examples.
#
# A private printer, usable only by fred. Spool data will be placed in fred's
# home directory. Note that fred must have write access to the spool directory,
# wherever it is.
;
;   comment = Fred's Printer
;   valid users = fred
;   path = /homes/fred
;   printer = freds_printer
;   public = no
;   writable = no
;   printable = yes

# A private directory, usable only by fred. Note that fred requires write
# access to the directory.
;
;   comment = Fred's Service
;   path = /usr/somewhere/private
;   valid users = fred
;   public = no
;   writable = yes
;   printable = no

# a service which has a different directory for each machine that connects
# this allows you to tailor configurations to incoming machines. You could
# also use the %u option to tailor it by user name.
# The %m gets replaced with the machine name that is connecting.
;
;comment = PC Directories
;path = /usr/pc/%m
;public = no
;writable = yes

# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
;
;   path = /usr/somewhere/else/public
;   public = yes
;   only guest = yes
;   writable = yes
;   printable = no

# The following two entries demonstrate how to share a directory so that two
# users can place files there that will be owned by the specific users. In this
# setup, the directory should be writable by both users and should have the
# sticky bit set on it to prevent abuse. Obviously this could be extended to
# as many users as required.
;
;   comment = Mary's and Fred's stuff
;   path = /usr/somewhere/shared
;   valid users = mary fred
;   public = no
;   writable = yes
;   printable = no
;   create mask = 0765



        path = /mnt/Media/Movie
        guest ok = yes
        write list = fly

[魔戒3]
        path = /public/魔戒3
        guest ok = yes


        path = /mnt/Soft
        valid users = fly


        path = /public
        guest ok = yes


        path = /mnt/Media/download/Linux
        guest ok = yes

wkp10251025 发表于 2004-8-8 11:11:36

GGGO大哥!!我的smb.conf和你的基本一致,就是没有开头的三行
dos charset = cp936
unix charset = cp936
map to guest = Bad User   
现已加上,另有一个地方;   hosts allow = 192.168.1. 192.168.2. 127. (你的是 hosts allow = 192.168.1. 127. )有点不一样。但无论我怎么改,实验室别的机子上打开我的子时总是说

无法访问WKP\\
找不到网络路径
打开WKP的属性时,又弹出:在网络上找不到Wkp服务器

实验室windows主机IP为192.168.0.91,而我用arp -a命令试图显示本机IP时,它没有任何反应:
# arp -a
#
我现在都不知道我的IP到底是什么了。

在的图形界面我都已设置好了:
工作组:workgroup
验证模式:共享
加密口令:否
来宾帐号:root

我现在该怎么办??? :cry:

------------------------------------
一定要连上局域网!!!!!!!!
页: [1] 2 3
查看完整版本: 如何配置smb连接局域网。