Tutorials to .com

Tutorials to .com » Os » Freebsd » FreeBSD install samba

FreeBSD install samba

Print View , by: iSee ,Total views: 126 ,Word Count: 1670 ,Date: Mon, 8 Jun 2009 Time: 12:30 AM

freebsd under SMB / CIFS protocol samba ─ ─ software running on a Unix system are many well-known free software, which makes Unix's like a Lan Manager server to Windows clients with file and print services. The current version of Samba to 2.0, FreeBSD can be adopted in the Packages Collection or the Ports Collection installed.

samba's Home for http://samba.org, including a large number of samba resources.

Although the SMB protocol mainly used for Microsoft networks, but has nothing to do with the emergence of samba. It is the author trying to Andrew Tridgell on a Sun workstation to complete the function of DEC Pathworks try to complete his other research. Pathworks is another SMB-based servers. At that time, Andrew Tridgell of the SMB and NetBIOS ignorant, but by analyzing the DOS client and the conduct of Pathworks, he completed the first version of Samba. Since then, as more and more people to join the Samba development, Microsft also open the SMB documents, Samba has become more perfect. The use of Samba users will normally be used by Windows NT and other SMB server, based on their experience, Samba server's performance over a variety of other SMB servers, including Windows NT.

samba major component of the software are:

smbd: This is the samba of the SMB server, which uses the SMB protocol to connect with customers, the completion of the de facto user authentication, rights management and file-sharing tasks;

nmbd: to provide NetBIOS name service daemon that can help customers location server and domain, as Windows NT on the WINS server;

smb.conf: the samba configuration file, in FreeBSD it is placed in / usr / local / etc directory.

swat: a Samba-specific WWW server for the client browser configuration through samba, provides a graphical Samba configuration interface;

smbclient: a simple SMB client computer used to access other SMB file share or print resources, such as Windows95 or NT computer, it is similar to the operation and ftp.

smbprint: a shell script that uses smbclient to a Windows computer sharing the printer to send the document to be printed.

nmblookup: query NetBIOS name for command-line tool.

  • Install samba

Packages Collection When Samba is installed, it will automatically install a startup script samba.sh.sample to / usr / local / etc / rc.d directory, can be renamed samba.sh, used to automatically start when the computer starts samba server smbd and nmbd. But to start samba, also need to change the / usr / local / etc / directory of the configuration file smb.conf, the installer will automatically install a sample document smb.conf.default, can be copied for the smb.conf file, and then then be modified.

# pkg_add samab-2.0.2.tgz
# cd /usr/local/etc
# cp smb.conf.default smb.conf
# cd rc.d
# cp samba.sh.sample samba.sh
# sh samba.sh
Samba
# pkg_add samab-2.0.2.tgz
# cd /usr/local/etc
# cp smb.conf.default smb.conf
# cd rc.d
# cp samba.sh.sample samba.sh
# sh samba.sh
Samba
# pkg_add samab-2.0.2.tgz
# cd /usr/local/etc
# cp smb.conf.default smb.conf
# cd rc.d
# cp samba.sh.sample samba.sh
# sh samba.sh
Samba
# pkg_add samab-2.0.2.tgz
# cd /usr/local/etc
# cp smb.conf.default smb.conf
# cd rc.d
# cp samba.sh.sample samba.sh
# sh samba.sh
Samba

To use samba, must be configured smb.conf, you can directly edit the configuration file, or use graphical interface to set up settings. As the samba is a very popular SMB server, so there is a wide range of graphical interface configuration procedures, samba2.0 itself is one of a swat it as a Web server can be configured WWW browser smb.conf. But even through the graphical interface to set up, but the manual editing of smb.conf settings are still the most basic way.

As the implementation of the above command shows the default smb.conf on the samba server to start normal, but the default configuration is not necessarily suitable for the user's specific settings. For example, the domain (or the Working Group) for the name of the default MYGROUP, and the actual network is not necessarily the use of the name. The following command uses the Samba client smbclient provided to view the default smb.conf start samba server settings.

# smbclient -L localhost -U%
Added interface ip=202.102.245.60 bcast=202.102.245.255 nmask=255.255.255.0
Domain=[MYGROUP] OS=[Unix] Server=[Samba 2.0.2]
Sharename   Type   Comment
---------   ----   -------
IPC$      IPC    IPC Service (Samba Server)
ascii     Printer  lj5gray-a4-ascii-mono
lp2      Printer  lj5gray-a4-auto-mono
lj5gray-a4-ra Printer  lj5gray auto raw
wb       Disk   Home Directories
Server        Comment
---------      -------
fbsdsrv       Samba Server
Workgroup      Master
---------      -------
MYGROUP
# smbclient -L localhost -U%
Added interface ip=202.102.245.60 bcast=202.102.245.255 nmask=255.255.255.0
Domain=[MYGROUP] OS=[Unix] Server=[Samba 2.0.2]
Sharename   Type   Comment
---------   ----   -------
IPC$      IPC    IPC Service (Samba Server)
ascii     Printer  lj5gray-a4-ascii-mono
lp2      Printer  lj5gray-a4-auto-mono
lj5gray-a4-ra Printer  lj5gray auto raw
wb       Disk   Home Directories
Server        Comment
---------      -------
fbsdsrv       Samba Server
Workgroup      Master
---------      -------
MYGROUP

From this output we can see that the default use of the Working Group for MYGROUP, sharing resources to provide IPC $, the user's personal directory wb, and systems that exist in a number of printer resources. samba's hostname using the computer to generate its NetBIOS name fbsdsrv.

The most normal circumstances, only need to change the name of the Working Group with the specific use of the name of the network is consistent, we can allow customers to use Windows computers to access the samba server, the user in the Windows registry, the use of their own where in samba Unix server login user name and password, you can access samba server on your own personal directory and printer resources.

FreeBSD will install Samba documentation / usr / local / share / doc / samba directory, some examples of settings file is installed to / usr / local / share / examples / samba directory, the documentation and examples for understanding the SMB protocol, Samba set up correctly is very important references.

  • Way to start samba

Start samba basic approach is to use the shell to provide Package ─ ─ program installed in / usr / local / etc / rc.d directory samba.sh. This process will start the daemon smbd and nmbd daemons two (to start the use of-D parameters). This computer will be able to start automatically when starting samba server.

Apart from the direct start, but also can be used to start the inetd super-server samba, then inetd.conf should include the following line:

netbios-ssn  stream  tcp nowait   root /usr/local/sbin/smbd   smbd
netbios-ns   dgram   udp wait     root /usr/local/sbin/nmbd   nmbd
netbios-ssn  stream  tcp nowait   root /usr/local/sbin/smbd   smbd
netbios-ns   dgram   udp wait     root /usr/local/sbin/nmbd   nmbd
netbios-ssn  stream  tcp nowait   root /usr/local/sbin/smbd   smbd
netbios-ns   dgram   udp wait     root /usr/local/sbin/nmbd   nmbd

Which netbios-ssn and netbios-ns in the / etc / services in the definition of the two for the NetBIOS ports, one for the NetBIOS session management, one for NetBIOS name resolution. When these two ports will be occupied after inetd, use the above startup script, or directly to start smbd and nmbd can not succeed. However, due to less efficient inetd to start the server slow, this configuration is only suitable for occasional file sharing of their own computer, not suitable for frequent visits will be the file / print server.

When using samba.sh after restart samba (or use inetd to start the samba), on the client computer from the Windows Network Neighborhood server found in the FreeBSD. .net use command or by using direct access to the server.

Since Windows is not configured in the WINS server, then there may be name resolution issue. In order to facilitate name resolution, you can lmhosts file in Windows to add the samba server NetBIOS name and IP configuration, to help resolve the name of Windows. Or use the samba server as a NBNS.

samba in / var / log of the visit left a lot of log files, log file name defined in the smb.conf. Usually at the beginning of the log file to log to the user or the computer's NetBIOS name for the suffix, such as the NetBIOS computer name for the cca, then it visits the server's log files for log.cca.


FreeBSD Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.