This section describes the various file managers that are available for managing the files on your PC-BSD system. It then shows how you can configure your PC-BSD system to share files with other systems in your network using Samba.

This section describes the various file managers that are available for managing the files on your PC-BSD system. It then shows how you can configure your PC-BSD system to share files with other systems in your network using Samba.

−

== File Managers and File Structure ==

+

== File Managers and File Structure == <!--T:3-->

−

Depending upon which window managers you have installed, different graphical file manager utilities may already be installed for you. You do not need to be logged into a specific window manager to use an installed file manager. For example, if KDE is installed, you can run its file manager from any window manager by typing '''dolphin'''. KDE, GNOME, LXDE, and XFCE install their own file managers while most of the unsupported desktops assume that you will install your favorite file manager. Table 9.3a summarizes the available file managers and indicates which desktop they are installed with. Some file managers can be installed independent of a desktop using [[Using AppCafe® | AppCafe®]] to install the PBI. Once a file manager is installed, type its name if you wish to run it from another desktop.

+

<!--T:4-->

+

Depending upon which window managers you have installed, different graphical file manager utilities may already be installed for you. You do not need to be logged into a specific window manager to use an installed file manager. For example, if KDE is installed, you can run its file manager from any window manager by typing '''dolphin'''. KDE, GNOME, LXDE, and XFCE install their own file managers while most of the unsupported desktops assume that you will install your favorite file manager. Table 9.3a summarizes the available file managers and indicates which desktop they are installed with. Some file managers can be installed independent of a desktop using {{local|link=AppCafe®}} to install the PBI. Once a file manager is installed, type its name if you wish to run it from another desktop.

When working with files on your PC-BSD system, save your own files to your home directory. Since most of the files outside of your home directory are used by the operating system and applications, you should not delete or modify any files outside of your home directory, unless you know what you are doing.

When working with files on your PC-BSD system, save your own files to your home directory. Since most of the files outside of your home directory are used by the operating system and applications, you should not delete or modify any files outside of your home directory, unless you know what you are doing.

+

<!--T:7-->

Table 9.3b summarizes the directory structure found on a PC-BSD system. '''man hier''' explains this directory structure in more detail.

Table 9.3b summarizes the directory structure found on a PC-BSD system. '''man hier''' explains this directory structure in more detail.

+

<!--T:8-->

{{Tbl-init|caption=9.3b: PC-BSD Directory Structure}}

{{Tbl-init|caption=9.3b: PC-BSD Directory Structure}}

−

{{Tbl-title|'''Directory'''}}

+

!width=18%|Directory

−

{{Tbl-title|'''Contents'''}}

+

!Contents

|-

|-

−

{{Tbl-cellw| /}}

+

| /

−

{{Tbl-cellw|pronounced as "root" and represents the beginning of the directory structure}}

+

|pronounced as "root" and represents the beginning of the directory structure

|-

|-

−

{{Tbl-cellg| /bin/ }}

+

| /bin/

−

{{Tbl-cellg| applications (binaries) that were installed with the operating system }}

+

| applications (binaries) that were installed with the operating system

{{Tbl-cellg| files that change (vary), such as log files and print jobs }}

+

| files that change (vary), such as log files and print jobs

|-

|-

|}

|}

−

== Samba ==

+

== Samba == <!--T:9-->

+

<!--T:10-->

{{citelink|url=http://samba.org/|txt=Samba}} allows any operating system to share volumes using Microsoft's CIFS protocol. There are two components to Samba:

{{citelink|url=http://samba.org/|txt=Samba}} allows any operating system to share volumes using Microsoft's CIFS protocol. There are two components to Samba:

+

<!--T:11-->

* '''client libraries:''' this allows an operating system to access ''' ''existing'' ''' CIFS shares. The client is built into the Windows and Mac OS X operating systems and is installed for you during the PC-BSD installation. Most Linux distros also install the Samba client; if your Linux distro does not, search its software repository.

* '''client libraries:''' this allows an operating system to access ''' ''existing'' ''' CIFS shares. The client is built into the Windows and Mac OS X operating systems and is installed for you during the PC-BSD installation. Most Linux distros also install the Samba client; if your Linux distro does not, search its software repository.

+

<!--T:12-->

* '''server:''' this allows a computer to act like a Windows server in that it can ''' ''create'' ''' shares and printers that are available to any CIFS client on the same network.

* '''server:''' this allows a computer to act like a Windows server in that it can ''' ''create'' ''' shares and printers that are available to any CIFS client on the same network.

+

<!--T:13-->

This section will demonstrate how to access shares using the Samba client as well as how to configure your PC-BSD system as a Samba server.

This section will demonstrate how to access shares using the Samba client as well as how to configure your PC-BSD system as a Samba server.

−

=== Using the Samba Client ===

+

=== Using the Samba Client === <!--T:14-->

+

<!--T:15-->

Since the Samba client libraries are pre-installed for you, you simply have to decide which utility you prefer to access existing Windows shares on your network. If a desktop is installed, you do not have to be logged into that desktop in order to use that utility.

Since the Samba client libraries are pre-installed for you, you simply have to decide which utility you prefer to access existing Windows shares on your network. If a desktop is installed, you do not have to be logged into that desktop in order to use that utility.

+

<!--T:16-->

Table 9.3c summarizes the available utilities (type a utility's name to launch it in any desktop), which desktop it installs with and whether or not a separate PBI is available, and a short description of how to access the available shares using that utility.

Table 9.3c summarizes the available utilities (type a utility's name to launch it in any desktop), which desktop it installs with and whether or not a separate PBI is available, and a short description of how to access the available shares using that utility.

+

<!--T:17-->

{{Tbl-init|caption=9.3c: Utilities that Support Windows Shares}}

{{Tbl-init|caption=9.3c: Utilities that Support Windows Shares}}

−

{{Tbl-title|'''Utility'''}}

+

!'''Utility'''

−

{{Tbl-title|'''Desktop/PBI'''}}

+

!'''Desktop/PBI'''

−

{{Tbl-title|'''How to Access Existing Shares'''}}

+

!'''How to Access Existing Shares'''

|-

|-

−

{{Tbl-cellw|dolphin}}

+

|dolphin

−

{{Tbl-cellw|[[KDE4|KDE]]}}

+

|{{local|link=KDE4|KDE}}

−

{{Tbl-cellw|in the left frame, click on ''Network'' ➜ ''Samba Shares'', then the Workgroup name; if the network requires a username and password to browse for shares, set this in ''[[Control Panel]]'' ➜ ''System Settings'' ➜ ''Sharing'' while in [[KDE4|KDE]] or type '''systemsettings''' ➜ ''Sharing'' while in another desktop}}

+

|in the left frame, click on <span class=traverse>''Network''{{rarr}}''Samba Shares''</span>, then the Workgroup name; if the network requires a username and password to browse for shares, set this in <span class=traverse>''{{local|link=Control Panel}}''{{rarr}}''System Settings''{{rarr}}''Sharing''</span> while in {{local|link=KDE4|KDE}} or type <span class=traverse>'''systemsettings'''{{rarr}}''Sharing''</span> while in another desktop

|add Local Network to toolbar by going to <span class=traverse>''Settings''{{rarr}}''Configure Toolbars''</span>; once in toolbar click <span class=traverse>''Local Network''{{rarr}}''Samba Shares''</span>

|-

|-

−

{{Tbl-cellg|mucommander}}

+

|mucommander

−

{{Tbl-cellg|PBI}}

+

|PBI

−

{{Tbl-cellg|click on ''Go'' ➜ ''Connect to server'' ➜ ''SMB''; input the NETBIOS name of server, name of share, name of domain (or workgroup), and the share's username and password}}

+

|click on <span class=traverse>''Go''{{rarr}}''Connect to server''{{rarr}}''SMB''</span>; input the NETBIOS name of server, name of share, name of domain (or workgroup), and the share's username and password

{{Tbl-cellw|in the left frame, click on ''Network'' ➜ ''Windows Network'}}

+

|in the left frame, click on <span class=traverse>''Network''{{rarr}}''Windows Network''</span>

|-

|-

|}

|}

−

=== Configuring the Samba Server ===

+

=== Configuring the Samba Server === <!--T:18-->

+

<!--T:19-->

If you would like to share folders or a printer attached to your PC-BSD system with other users in your network, configure the built-in Samba server.

If you would like to share folders or a printer attached to your PC-BSD system with other users in your network, configure the built-in Samba server.

+

<!--T:20-->

In order to create shares, Samba's configuration file, {{citelink|url=http://samba.org/samba/docs/man/manpages-3/smb.conf.5.html|txt=smb.conf}}, needs to be modified. You can either edit this file manually or use a GUI utility such as {{citelink|url=http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html|txt=SWAT}}. This section will demonstrate both methods.

In order to create shares, Samba's configuration file, {{citelink|url=http://samba.org/samba/docs/man/manpages-3/smb.conf.5.html|txt=smb.conf}}, needs to be modified. You can either edit this file manually or use a GUI utility such as {{citelink|url=http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html|txt=SWAT}}. This section will demonstrate both methods.

−

==== Edit smb.conf Manually ====

+

==== Edit smb.conf Manually ==== <!--T:21-->

+

<!--T:22-->

To modify the file manually, become the superuser and copy the sample file to the configuration directory:

To modify the file manually, become the superuser and copy the sample file to the configuration directory:

Open the copied file in your favorite editor and review the default settings, editing them to match your network. In particular, check these global settings:

Open the copied file in your favorite editor and review the default settings, editing them to match your network. In particular, check these global settings:

−

+

[[File:Swat.jpeg|thumb|393px|'''Figure 9.3a: SWAT Graphical Menu''']]

* '''workgroup =''' must match the Windows workgroup or domain name; unless the administrator has changed it, the default workgroup name is WORKGROUP

* '''workgroup =''' must match the Windows workgroup or domain name; unless the administrator has changed it, the default workgroup name is WORKGROUP

+

<!--T:25-->

* '''security =''' the security modes are described in the {{citelink|url=http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/ServerType.html#id2559114|txt=Samba HOWTO}}

* '''security =''' the security modes are described in the {{citelink|url=http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/ServerType.html#id2559114|txt=Samba HOWTO}}

+

<!--T:26-->

* '''hosts allow =''' you should input the network address to restrict connections to the local network

* '''hosts allow =''' you should input the network address to restrict connections to the local network

+

<!--T:27-->

In the share definitions section, review the ''[homes]'' settings. You can also define your own shares. This example will share the ''Downloads'' directory of user1 as read-only:

In the share definitions section, review the ''[homes]'' settings. You can also define your own shares. This example will share the ''Downloads'' directory of user1 as read-only:

+

<!--T:28-->

{{txtbox|pre|box=[Downloads]

{{txtbox|pre|box=[Downloads]

path = /usr/home/user1/Downloads

path = /usr/home/user1/Downloads

Line 235:

Line 265:

writable = no}}

writable = no}}

+

<!--T:29-->

To test your changes, restart the Samba service:

To test your changes, restart the Samba service:

+

<!--T:30-->

{{txtbox|pre|box='''/usr/local/etc/rc.d/samba restart'''}}

{{txtbox|pre|box='''/usr/local/etc/rc.d/samba restart'''}}

+

<!--T:31-->

and try browsing to the share from another system. Note that you may have to first map a drive to the share in order for it to appear in Windows Explorer or within the file manager utility of another PC-BSD or Linux system.

and try browsing to the share from another system. Note that you may have to first map a drive to the share in order for it to appear in Windows Explorer or within the file manager utility of another PC-BSD or Linux system.

−

==== Create Shares Using SWAT ====

+

==== Create Shares Using SWAT ==== <!--T:32-->

+

<!--T:33-->

SWAT provides a graphical front-end to ''smb.conf'' through a web browser.

SWAT provides a graphical front-end to ''smb.conf'' through a web browser.

+

<!--T:34-->

To enable SWAT, remove the # at the beginning of this line in ''/etc/inetd<nowiki>.</nowiki>conf'':

To enable SWAT, remove the # at the beginning of this line in ''/etc/inetd<nowiki>.</nowiki>conf'':

To connect to SWAT, open a web browser and input the IP address of the PC-BSD computer followed by '':901''. When prompted, input the username ''root'' and the password associated with the superuser account. In the example shown in Figure 9.3a, the user has clicked on the "Globals" button in order to view the global settings.

To connect to SWAT, open a web browser and input the IP address of the PC-BSD computer followed by '':901''. When prompted, input the username ''root'' and the password associated with the superuser account. In the example shown in Figure 9.3a, the user has clicked on the "Globals" button in order to view the global settings.

−

'''Figure 9.3a: SWAT Graphical Menu'''

+

<!--T:40-->

−

+

−

[[File:Swat.jpeg]]

+

−

+

One of the nice features of SWAT is the built-in help system. If you need more information about an option, simply click its "Help" hyperlink to access that section of the Samba documentation. The "shares" button allows you to quickly create shares and the "view" button allows you to review the current configuration.

One of the nice features of SWAT is the built-in help system. If you need more information about an option, simply click its "Help" hyperlink to access that section of the Samba documentation. The "shares" button allows you to quickly create shares and the "view" button allows you to review the current configuration.

−

<noinclude>{{refheading}}</noinclude>

+

<!--T:41-->

−

<noinclude>{{GroupListHeading|group=tables}}</noinclude>

+

<noinclude>

<noinclude>

+

{{refheading}}

+

{{GroupListHeading|group=tables}}

[[category:handbook]]

[[category:handbook]]

[[category:Common Tasks]]

[[category:Common Tasks]]

[[category:Files and File Sharing]]

[[category:Files and File Sharing]]

+

</translate>

+

<languages/>

</noinclude>

</noinclude>

Revision as of 01:26, 16 December 2013

Files and File SharingProtection (edit): sysopEdited by: Tigersharke

This section describes the various file managers that are available for managing the files on your PC-BSD system. It then shows how you can configure your PC-BSD system to share files with other systems in your network using Samba.

Contents

File Managers and File Structure

Depending upon which window managers you have installed, different graphical file manager utilities may already be installed for you. You do not need to be logged into a specific window manager to use an installed file manager. For example, if KDE is installed, you can run its file manager from any window manager by typing dolphin. KDE, GNOME, LXDE, and XFCE install their own file managers while most of the unsupported desktops assume that you will install your favorite file manager. Table 9.3a summarizes the available file managers and indicates which desktop they are installed with. Some file managers can be installed independent of a desktop using AppCafe® to install the PBI. Once a file manager is installed, type its name if you wish to run it from another desktop.

When working with files on your PC-BSD system, save your own files to your home directory. Since most of the files outside of your home directory are used by the operating system and applications, you should not delete or modify any files outside of your home directory, unless you know what you are doing.

Table 9.3b summarizes the directory structure found on a PC-BSD system. man hier explains this directory structure in more detail.

Samba

Samba[10] allows any operating system to share volumes using Microsoft's CIFS protocol. There are two components to Samba:

client libraries: this allows an operating system to access existing CIFS shares. The client is built into the Windows and Mac OS X operating systems and is installed for you during the PC-BSD installation. Most Linux distros also install the Samba client; if your Linux distro does not, search its software repository.

server: this allows a computer to act like a Windows server in that it can create shares and printers that are available to any CIFS client on the same network.

This section will demonstrate how to access shares using the Samba client as well as how to configure your PC-BSD system as a Samba server.

Using the Samba Client

Since the Samba client libraries are pre-installed for you, you simply have to decide which utility you prefer to access existing Windows shares on your network. If a desktop is installed, you do not have to be logged into that desktop in order to use that utility.

Table 9.3c summarizes the available utilities (type a utility's name to launch it in any desktop), which desktop it installs with and whether or not a separate PBI is available, and a short description of how to access the available shares using that utility.

in the left frame, click on Network → Samba Shares, then the Workgroup name; if the network requires a username and password to browse for shares, set this in Control Panel → System Settings → Sharing while in KDE or type systemsettings → Sharing while in another desktop

Configuring the Samba Server

If you would like to share folders or a printer attached to your PC-BSD system with other users in your network, configure the built-in Samba server.

In order to create shares, Samba's configuration file, smb.conf[11], needs to be modified. You can either edit this file manually or use a GUI utility such as SWAT[12]. This section will demonstrate both methods.

Edit smb.conf Manually

To modify the file manually, become the superuser and copy the sample file to the configuration directory:

hosts allow = you should input the network address to restrict connections to the local network

In the share definitions section, review the [homes] settings. You can also define your own shares. This example will share the Downloads directory of user1 as read-only:

[Downloads]

path = /usr/home/user1/Downloads
public = yes

writable = no

To test your changes, restart the Samba service:

/usr/local/etc/rc.d/samba restart

and try browsing to the share from another system. Note that you may have to first map a drive to the share in order for it to appear in Windows Explorer or within the file manager utility of another PC-BSD or Linux system.

Create Shares Using SWAT

SWAT provides a graphical front-end to smb.conf through a web browser.

To enable SWAT, remove the # at the beginning of this line in /etc/inetd.conf:

#swat stream tcp nowait/400 root /usr/local/sbin/swat swat

Add the following line to /etc/rc.conf:

inetd_enable=”YES”

And start inetd:

/etc/rc.d/inetd start

To connect to SWAT, open a web browser and input the IP address of the PC-BSD computer followed by :901. When prompted, input the username root and the password associated with the superuser account. In the example shown in Figure 9.3a, the user has clicked on the "Globals" button in order to view the global settings.

One of the nice features of SWAT is the built-in help system. If you need more information about an option, simply click its "Help" hyperlink to access that section of the Samba documentation. The "shares" button allows you to quickly create shares and the "view" button allows you to review the current configuration.