Difference between revisions of "Files and File Sharing Instruction"

From PC-BSD Wiki
Jump to: navigation, search
m (File Managers and File Structure)
 
(36 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>{{NavHeader|back=Windows Emulation|forward=Remote Desktop}}</noinclude>
+
{{givechoiceVers|Files and File Sharing}}
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===
+
 
+
Depending upon which desktops you have installed, different graphical file manager utilities are available for PC-BSD. Note that you don't need to be logged into a window manager to use an installed file manager. For example, if KDE is installed, you can run its file manager from any desktop by typing '''dolphin'''. The supported desktops provide their own file managers while most of the unsupported desktops assume that you will install your favourite file manager. Table 8.6a 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.
+
 
+
'''Table 8.6a: Available File Managers'''
+
 
+
{| border="1"
+
|'''File Manager'''   
+
|'''Desktop/PBI''' 
+
|'''Screenshots''' 
+
|'''Notes'''
+
|-
+
|dolphin
+
|KDE
+
|http://dolphin.kde.org/features.html
+
|
+
|-
+
|emelfm2
+
|PBI
+
|http://emelfm2.net/wiki/ScreenShots
+
|
+
|-
+
|/usr/local/GNUstep/Apps/FSViewer.app/FSViewer
+
|Window Maker
+
|http://www.bayernline.de/~gscholz/linux/fsviewer/
+
|
+
|-
+
|krusader
+
|PBI
+
|http://www.krusader.org/screenshots.php
+
|
+
|-
+
|mucommander
+
|PBI
+
|http://www.mucommander.com/screenshots.php
+
|
+
|-
+
|nautilus
+
|GNOME
+
|http://live.gnome.org/Nautilus/Screenshots
+
|
+
|-
+
|pcmanfm
+
|LXDE or PBI
+
|http://lxde.org/easy_fast_file_management_pcmanfm
+
|
+
|-
+
|thunar
+
|XFCE or PBI
+
|http://www.xfce.org/projects/thunar
+
|unable to automount internal NTFS disks (try pcmanfm or emelfm2 instead)
+
|-
+
|xfe
+
|PBI
+
|http://roland65.free.fr/xfe/index.php?page=screenshots
+
|
+
|-
+
|}
+
 
+
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 8.6b summarizes the directory structure found on a PC-BSD system. '''man hier''' explains this directory structure in more detail.
+
 
+
'''Table 8.6b: PC-BSD Directory Structure'''
+
 
+
{{Tbl-init|width=72%}}
+
{{Tbl-title|'''Directory'''}}
+
{{Tbl-title|'''Contents'''}}
+
|-
+
{{Tbl-line|bg=ff|align=left| /}}
+
{{Tbl-line|bg=ff|align=left|pronounced as "root" and represents the beginning of the directory structure}}
+
|-
+
{{Tbl-line|align=left| /bin/ }}
+
{{Tbl-line|align=left| applications (binaries) that were installed with the operating system }}
+
|-
+
{{Tbl-line|bg=ff|align=left| /boot/ }}
+
{{Tbl-line|bg=ff|align=left| stores the startup code, including kernel modules (such as hardware drivers) }}
+
|-
+
{{Tbl-line|align=left| /compat/linux/ }}
+
{{Tbl-line|align=left| Linux software compatibility files }}
+
|-
+
{{Tbl-line|bg=ff|align=left| /dev/ }}
+
{{Tbl-line|bg=ff|align=left| files which are used by the operating system to access devices }}
+
|-
+
{{Tbl-line|align=left| /etc/ }}
+
{{Tbl-line|align=left| operating system configuration files }}
+
|-
+
{{Tbl-line|bg=ff|align=left| /etc/X11/ }}
+
{{Tbl-line|bg=ff|align=left| the xorg.conf configuration file }}
+
|-
+
{{Tbl-line|align=left| /etc/rc.d/ }}
+
{{Tbl-line|align=left| operating system startup scripts }}
+
|-
+
{{Tbl-line|bg=ff|align=left| /home/ }}
+
{{Tbl-line|bg=ff|align=left| subdirectories for each user account; each user should store their files in their own home directory }}
+
|-
+
{{Tbl-line|align=left| /lib/ }}
+
{{Tbl-line|align=left| operating system libraries needed for applications }}
+
|-
+
{{Tbl-line|bg=ff|align=left| /libexec/ }}
+
{{Tbl-line|bg=ff|align=left| operating system libraries and binaries }}
+
|-
+
{{Tbl-line|align=left| /media/ }}
+
{{Tbl-line|align=left| mount point for storage media such as DVDs and USB drives }}
+
|-
+
{{Tbl-line|bg=ff|align=left| /mnt/ }}
+
{{Tbl-line|bg=ff|align=left| another mount point }}
+
|-
+
{{Tbl-line|bg=ff|align=left|  /proc/ }}
+
{{Tbl-line|bg=ff|align=left| the proc filesystem required by some Linux applications }}
+
|-
+
{{Tbl-line|align=left|/rescue/ }}
+
{{Tbl-line|align=left|necesary programs for emergency recovery }}
+
|-
+
{{Tbl-line|bg=ff|align=left| /root/ }}
+
{{Tbl-line|bg=ff|align=left| administrative account's home directory }}
+
|-
+
{{Tbl-line|align=left| /sbin/ }}
+
{{Tbl-line|align=left| operating system applications; typically only the superuser can run these applications }}
+
|-
+
{{Tbl-line|bg=ff|align=left| /tmp/ }}
+
{{Tbl-line|bg=ff|align=left| temporary file storage; files stored here may disappear when the system reboots }}
+
|-
+
{{Tbl-line|align=left| /usr/bin/ }}
+
{{Tbl-line|align=left| contains most of the command line programs available to users }}
+
|-
+
{{Tbl-line|bg=ff|align=left| /usr/local/ }}
+
{{Tbl-line|bg=ff|align=left| contains the binaries, libraries, startup scripts, documentation, and configuration files used by applications installed from ports or packages }}
+
|-
+
{{Tbl-line|bg=ff|align=left| /usr/pbi/ }}
+
{{Tbl-line|bg=ff|align=left| contains the binaries, libraries, startup scripts, documentation, and configuration files used by instaleld PBIs }}
+
|-
+
{{Tbl-line|align=left| /usr/local/share/fonts/ }}
+
{{Tbl-line|align=left| system wide fonts for graphical applications }}
+
|-
+
{{Tbl-line|bg=ff|align=left| /usr/local/share/icons/ }}
+
{{Tbl-line|bg=ff|align=left| system wide icons }}
+
|-
+
{{Tbl-line|align=left| /usr/ports/ }}
+
{{Tbl-line|align=left| location of system ports tree (if installed) }}
+
|-
+
{{Tbl-line|bg=ff|align=left| /usr/share/ }}
+
{{Tbl-line|bg=ff|align=left| system documentation and man pages }}
+
|-
+
{{Tbl-line|align=left| /usr/sbin/ }}
+
{{Tbl-line|align=left| command line programs for the superuser }}
+
|-
+
{{Tbl-line|bg=ff|align=left| /usr/src/ }}
+
{{Tbl-line|bg=ff|align=left| location of system source code (if installed) }}
+
|-
+
{{Tbl-line|align=left| /var/ }}
+
{{Tbl-line|align=left| files that change (vary), such as log files and print jobs }}
+
|-
+
|}
+
 
+
==Samba==
+
 
+
[http://samba.org/ Samba] 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 the Windows shares on your network. Remember, if a desktop is installed, you do not have to be logged into that desktop in order to use that utility.
+
 
+
Table 8.6c 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 8.6c: Utilities that Support Windows Shares'''
+
 
+
{| border="1"
+
|'''Utility'''   
+
|'''Desktop/PBI''' 
+
|'''How to Access Existing Shares''' 
+
|-
+
|dolphin
+
|KDE
+
|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
+
|-
+
|konqueror
+
|KDE
+
|in the location bar, type ''smb:/''
+
|-
+
|krusader
+
|PBI
+
|add Local Network to toolbar by going to Settings -> Configure Toolbars; once in toolbar click Local Network -> Samba Shares
+
|-
+
|mucommander
+
|PBI
+
|click on Go -> Connect to server -> SMB; ; here you can input the NETBIOS name of server, name of share, name of domain (or workgroup), and the share's username and password
+
|-
+
|nautilus
+
|GNOME
+
|click on Go -> Network -> Windows Network
+
|-
+
|thunar
+
|XFCE or PBI
+
|in the left frame, click on Network -> Windows Network
+
|-
+
|}
+
 
+
===Installing and 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, install and configure the Samba server. Go to Control Panel -> System Manager -> System Packages -> Services -> Samba and click Apply Changes.
+
 
+
In order to create your shares, you need to modify Samba's configuration file, [http://samba.org/samba/docs/man/manpages-3/smb.conf.5.html smb.conf]. You can either edit this file manually or use a GUI utility such as [http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT]. 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:
+
 
+
'''cp /usr/local/share/examples/samba34/smb.conf.sample /usr/local/etc/smb.conf'''
+
 
+
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:
+
 
+
* '''workgroup =''' must match the Windows workgroup or domain name; unless the administrator has changed it, the default workgroup name is WORKGROUP
+
 
+
* '''security =''' the security modes are described [http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/ServerType.html#id2559114 here]
+
 
+
* '''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 8.6a, the user has clicked on the Globals button in order to view the global settings.
+
 
+
'''Figure 8.6a: SWAT Graphical Menu'''
+
 
+
[[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.
+
<noinclude>[[category:handbook]]</noinclude>
+

Latest revision as of 01:12, 23 December 2013

NOTE: This page or its content was moved. The handbook portion of the wiki now primarily focuses on two versions, the most recent release and the upcoming (work-in-progress). This is an imperfect solution to a recurring problem which may not always be solved by the provided links below.

[edit] Which would you like?

Release (10.0)
Files and File Sharing
Upcoming (10.1)
Files and File Sharing