居无为 品书香手机网
导航

主页 > 电子设备技术 > 电器电路基础 > > 详细内容

在Linux操作系统使用SMB

 最新 Samba 的原始程式可以取得自:

 ftp://nimbus.anu.edu.au/pub/tridge/samba/

 然而,如果已安装 linux 的 Redhat 版本,你可以使用软体套件{kage} 来

 安装它.有些其他版本也包含 Samba 的binaries

 以下两个 daemon 对 Samba 软体套件 是必要的. 它们一般是被安装在  

 /usr/sbin ,而可在开机时,从系统起动的 scripts或inetd来执行.

 smbd (The SMB daemon)

 nmbd (提供 Net nameserver 的支援给 clients)

 一般而言,以下的 Samba 的 binaries 被安装在 /usr/bin, 虽然说它的位置是可选择性.

 smbclient (一种供给 UNIX 机器用的 SMB client{程式})

 smbprint (一种 script 用在列印於 SMB 主机{host}上的列表机)

 smbprint.sysv (同上, 但是提供给 SVR4 UNIX 机器用的)

 smbstatus (列出对当地主机之目前 SMB 连结情况)

 smbrun (一种 'glue' script 用来简易地执行应用程式於 SMB 主机)

 执行两个 daemon

 这两个 daemon 是 /usr/sbin/smbd 和 /usr/sbin/nmbd.

 你可以执行 Samba daemon 从 inetd 或当成单独的程序. 如果你正设定一个永久档案伺

 服器,你应该从 inetd 来执行,所以如果他们死掉,那将重新开始.如果你只是偶尔想要使

 用 SMB 伺服器,或者用系统管理来辅助,当你需要时,你可以藉由使用 /etc/rc.d/init.d

 script,或甚至直接手动的.

 要从 inetd 来执行 daemon , 请放以下几行在 inetd 组态档, /etc/inetd.conf:

 # SAMBA NetBIOS serves (for PC file and print sharing)

 netbios-ssn stream tcp nowait root /usr/sbin/smbd smbd

 netbios-ns dgram udp wait root /usr/sbin/nmbd nmbd

 然後下指令以便重新启动 inetd daemon :

 kill -HUP 1

 要从系统启动的 script 来执行 daemon, 请把以下的 script 置於一个叫做

 /etc/rc.d/init.d/smb 档, 而且 symbolically link 到注释{comments}所说明的档案:

 #!/bin/sh

 #

 # /etc/rc.d/init.d/smb - starts and stops SMB services.

 #

 # The following files should be synbolic links to this file:

 # symlinks: /etc/rc.d/rc1.d/K35smb (Kills SMB services on shutdown)

 # /etc/rc.d/rc3.d/S91smb (Starts SMB services in multiuser mode)

 # /etc/rc.d/rc6.d/K35smb (Kills SMB services on reboot)

 #

 # Source function library.

 . /etc/rc.d/init.d/functions

 # Source networking configuration.

 . /etc/sysconfig/network


相关文章