Sharing Fedora Linux Folders with Remote Windows Systems

From Techotopia
Revision as of 13:46, 23 August 2007 by Neil (Talk | contribs) (Sharing Ubuntu Linux Folders)

Jump to: navigation, search

Although Linux is increasingly making inroads into the desktop market, its origins are very much server oriented. It is not surprising, therefore, that Linux has the ability to act as a file server. Files on a Linux system can be accessed both from other Linux (and UNIX) systems and Windows based systems over network connections.

Remote filesystem access between Linux and UNIX systems is achieved using technology called Network File System (NFS) which is discussed in Sharing Ubuntu Linux Folders with Remote Linux and UNIX Systems. Windows systems share resources such as filesystems and printers using something called Server Message Block (SMB). In order for a Linux system to serve such resources over a network to a Windows system it must, therefore, support SMB. This is achieved using Linux technology known as Samba.

In this chapter we will look in detail at the steps necessary to share filesystem resources on a Fedora Linux system with remote Windows Systems.


Installing Samba on a Fedora Linux System

The default settings used during the Fedora Linux installation process do not install Samba. Unless you specifically requested that Samba be installed it is unlikely that you have Samba installed on your system. To check whether Samba is installed, open a terminal window and run the following rpm command:

rpm -q samba

If Samba is installed, the rpm command will generate output similar to the following:


If Samba is not installed, rpm will return with "package samba is not installed".

If Samba is not installed on your system it can be installed using the yum command-line tool:

su -
yum install samba

The above command will install both the samba package and the samba-common dependency package.

Starting the Samba Service on Fedora Linux

Having installed the Samba service packags the next step is to start those services running. This can be done either from the command line, or from the Service Configuration Tool.

To verify that the Samba service is running from the command-line execute following command from a Terminal window:

/sbin/service smb status

If the service is stopped it can be started as follows (note that this command must be performed with super user privileges:

su -
/sbin/service smb start

Alternatively, to configure the Samba service using the GUI based Service Configuration Tool, select it from the System->Administration->Server Settings->Services menu. When the tool loads, scroll down the list of services to find smb. Check the box next to the service if you want the service to start on reboot, and then click the Start button. Check the status panel to the right of the dialog to verify the service is running (a message similar to "smb (pid 543212 is running..." will be displayed).

Configuring the Fedora Firewall to Enable Samba

Next, the firewall needs to be configured to allow Samba traffic. To achieve this, run the Security Level Configuration tool by selecting the System->Administration->Firewall and SELinux menu option. If the firewall is enabled, make sure that the check box next to NFS4 is set and then click on Apply and Close.

Sharing Fedora Linux Folders

Once the Samba File sharing is installed and running, the next step is to configure the filesystem directories (also known as folders) to be shared with the Windows systems.

The easiest way to achieve this is to use the Samba Server Configuration tool. As with the Samba server packages, it is likely that this tool was not installed by default on your system. To check if it is installed run the following command in a Terminal window:

rpm -q system-config-samba

If the tool is not installed it may be installed as follows:

su - 
yum install system-config-samba

Once installed, the Samba Server Configuration may be launched from the System->Preferences->System->Samba desktop menu option, or from the command-line:


When loaded, the Samba Server Configuration tool will appear as follows:

Fedora Samba Server Configuration Tool

Click on the Add button to add a new folder to share. The following dialog will subsequently appear:

Add a new Samba Shared Folder

This dialog is used to define which folder will be shared. Select from the Path:drop down menu. You can select either a user's directory, the root directory (not advised for security reasons) use the Other... option to browse the file system to find the path you wish to share. Having selected a folder, enter the Windows networks (smb) for the Share through option and then provide a resource name by which the folder will be accessed from the Windows system.

Click on OK when you have configured the information in this dialog and then select the General Properties of the main Shared Folders dialog which will display the following options:

Ubuntu shared folders general.jpg

Enter the name of your Windows Workgroup and click on Shared Folders tab to return to the initial screen.

The final step is to configure a password for samba access to your shared folders. From a terminal window, run the following command (where username is the username you use to log into your Ubuntu system):

sudo smbpasswd -a username

Once completed, the folder you specified will be visible from any Windows systems on the same network (and workgroup specified in the General Properties page) as your Ubuntu Linux system. When prompted on the Windows system for the password to access the resource, enter the password defined using smbpasswd above. You should now have remote access to your Linux folder from the Windows system.