Difference between revisions of "Sharing Fedora Linux Folders with Remote Windows Systems"

From Techotopia
Jump to: navigation, search
(Sharing Fedora Linux Folders)
Line 8: Line 8:
  
  
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.
+
Although Linux is increasingly making inroads into the desktop market, its origins are very much server based. It is not surprising therefore that Linux has the ability to act as a file server. It is also extremely common for Linux and Windows systems to be used side by side both in home and business environments. It is vital, therefore, that files on a Linux system be accessible to both Linux, UNIX and Windows based systems over network connections. Similarly, shared folders residing on Windows systems must also be accessible from Fedora systems.
  
Remote filesystem access between Linux and UNIX systems is achieved using technology called Network File System (NFS) which is discussed in [[Sharing Fedora 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''.
+
Windows systems share resources such as file systems 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 and vice versa it must, therefore, support SMB. This is achieved using Linux based technology called Samba. In addition to providing integration between Linux and Windows systems, Samba may also be used to provide folder sharing between Linux systems (as an alternative to NFS which was covered in Sharing Fedora Linux Folders with Remote Linux and UNIX Systems).
  
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.
+
In this chapter we will look at the steps necessary to share file system resources and printers on an Fedora system with remote Windows and Linux systems.  
  
 
== Installing Samba on a Fedora Linux System ==
 
== 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:
+
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 (Applications->System Tools->Terminal) and run the following ''rpm'' command:
  
 
<pre>
 
<pre>
Line 37: Line 37:
 
</pre>
 
</pre>
  
The above command will install both the ''samba'' package and the ''samba-common'' dependency package.
+
The above command will install both the ''samba'' package and the ''samba-common'' dependency package.
 +
 
 +
If you prefer to use the graphical tool to perform the Samba installation, select ''System->Administration->Add/Remove Software'', enter the root password if prompted to do so and then perform a search for Samba. When the list of matching packages appears, set the checkbox next to ''Server and Client software to operate with Windows machines'' and click ''Apply''.
  
 
== Starting the Samba Service on Fedora Linux ==
 
== 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.  
+
Having installed the Samba service packages, 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:
 
To verify that the Samba service is running from the command-line execute following command from a Terminal window:
Line 49: Line 51:
 
</pre>
 
</pre>
  
If the service is ''stopped'' it can be started as follows (note that this command must be performed with super user privileges:
+
If the service is ''stopped'' it can be started as follows (note that this command must be performed with super user privileges):
  
 
<pre>
 
<pre>
Line 56: Line 58:
 
</pre>
 
</pre>
  
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).
+
Alternatively, to configure the Samba service using the GUI based Service Configuration Tool, select it from the ''System->Administration->Services'' menu. When the tool loads, scroll down the list of services to find ''smb'' and select it. If you want the service to start on reboot click on ''Enable'' and then click the ''Start'' button to start the service now. Check the status panel to the right of the dialog to verify the service is running.
  
 
== Configuring the Fedora Firewall to Enable Samba ==
 
== 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''.
+
Next, the firewall needs to be configured to allow Samba traffic. To achieve this, run the Firewall Configuration tool by selecting the ''System->Administration->Firewall'' menu option.
 +
 
 +
If you would like to access shared resources hosted on other Windows or Linux based systems, select check box next to the ''Samba Client'' item in the Trusted Services list. Similarly, if you would like other Linux and Windows system to be able to access shared resources on your system, enable the ''Samba Client'' option. Click ''Apply'' top commit the firewall configuration changes.  
  
 
== Sharing Fedora Linux Folders ==
 
== Sharing Fedora Linux Folders ==
Line 66: Line 70:
 
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.
 
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:
+
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 Fedora system. To check if it is installed run the following command in a Terminal window:
  
 
<pre>
 
<pre>
Line 79: Line 83:
 
</pre>
 
</pre>
  
Once installed, the Samba Server Configuration may be launched from the ''System->Preferences->System->Samba'' desktop menu option, or from the command-line:
+
Once installed, the Samba Server Configuration may be launched from the ''System->Administration->Samba'' desktop menu option, or from the command-line:
  
 
<pre>
 
<pre>
Line 86: Line 90:
  
 
When loaded, the Samba Server Configuration tool will appear as follows:
 
When loaded, the Samba Server Configuration tool will appear as follows:
 +
  
 
[[Image:fedora_samba_configuration.jpg|Fedora Samba Server Configuration Tool]]
 
[[Image:fedora_samba_configuration.jpg|Fedora Samba Server Configuration Tool]]
 +
  
 
Select ''Preferences->Server Settings...'' and enter the name of the Windows Workgroup to which you wish this server to belong and click ''OK''.
 
Select ''Preferences->Server Settings...'' and enter the name of the Windows Workgroup to which you wish this server to belong and click ''OK''.
Line 94: Line 100:
  
 
Click on the ''Add'' button in the toolbar to add a new folder to share. The following dialog will subsequently appear:
 
Click on the ''Add'' button in the toolbar to add a new folder to share. The following dialog will subsequently appear:
 +
  
 
[[Image:fedora_samba_folders_add.jpg| Add a new Samba Shared Folder]]
 
[[Image:fedora_samba_folders_add.jpg| Add a new Samba Shared Folder]]
 +
  
 
Type or browse to the path you wish to share and enter a share name if you do not like the one provided by the tool. Set the ''Writable'' and ''Visible'' toggles to your desired settings and click ''OK''. Select the ''Access''' and either select a user added in the previous step,, or allow access to all users.
 
Type or browse to the path you wish to share and enter a share name if you do not like the one provided by the tool. Set the ''Writable'' and ''Visible'' toggles to your desired settings and click ''OK''. Select the ''Access''' and either select a user added in the previous step,, or allow access to all users.
  
 
Click on ''OK'' when you have configured the information in this dialog. The main dialog should appear with the new share listed:
 
Click on ''OK'' when you have configured the information in this dialog. The main dialog should appear with the new share listed:
 +
<google>ADSDAQBOX_FLOW</google>
  
  
<google>ADSDAQBOX_FLOW</google>
 
 
[[Image:fedora_new_share.jpg]]
 
[[Image:fedora_new_share.jpg]]
 +
  
 
Once completed, the folder you specified will be visible from any Windows systems on the same network (and workgroup specified in the Server Settings page) as your Fedora Linux system. You should now have remote access to your Linux folder from the Windows system.
 
Once completed, the folder you specified will be visible from any Windows systems on the same network (and workgroup specified in the Server Settings page) as your Fedora Linux system. You should now have remote access to your Linux folder from the Windows system.

Revision as of 18:23, 22 June 2009

PreviousTable of ContentsNext
Sharing Fedora Linux Folders with Remote Linux and UNIX SystemsConfiguring a Fedora Linux Based Web Server


Although Linux is increasingly making inroads into the desktop market, its origins are very much server based. It is not surprising therefore that Linux has the ability to act as a file server. It is also extremely common for Linux and Windows systems to be used side by side both in home and business environments. It is vital, therefore, that files on a Linux system be accessible to both Linux, UNIX and Windows based systems over network connections. Similarly, shared folders residing on Windows systems must also be accessible from Fedora systems.

Windows systems share resources such as file systems 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 and vice versa it must, therefore, support SMB. This is achieved using Linux based technology called Samba. In addition to providing integration between Linux and Windows systems, Samba may also be used to provide folder sharing between Linux systems (as an alternative to NFS which was covered in Sharing Fedora Linux Folders with Remote Linux and UNIX Systems).

In this chapter we will look at the steps necessary to share file system resources and printers on an Fedora system with remote Windows and Linux systems.


Contents


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 (Applications->System Tools->Terminal) and run the following rpm command:

rpm -q samba

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

samba-3.0.25b-2.fc7

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.

If you prefer to use the graphical tool to perform the Samba installation, select System->Administration->Add/Remove Software, enter the root password if prompted to do so and then perform a search for Samba. When the list of matching packages appears, set the checkbox next to Server and Client software to operate with Windows machines and click Apply.

Starting the Samba Service on Fedora Linux

Having installed the Samba service packages, 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->Services menu. When the tool loads, scroll down the list of services to find smb and select it. If you want the service to start on reboot click on Enable and then click the Start button to start the service now. Check the status panel to the right of the dialog to verify the service is running.


Configuring the Fedora Firewall to Enable Samba

Next, the firewall needs to be configured to allow Samba traffic. To achieve this, run the Firewall Configuration tool by selecting the System->Administration->Firewall menu option.

If you would like to access shared resources hosted on other Windows or Linux based systems, select check box next to the Samba Client item in the Trusted Services list. Similarly, if you would like other Linux and Windows system to be able to access shared resources on your system, enable the Samba Client option. Click Apply top commit the firewall configuration changes.

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 Fedora 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->Administration->Samba desktop menu option, or from the command-line:

system-config-samba

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


Fedora Samba Server Configuration Tool


Select Preferences->Server Settings... and enter the name of the Windows Workgroup to which you wish this server to belong and click OK.

Select Preferences->Samba Users... and select a user from the list which will be used to share folders with the Window's system. After selecting the user, enter the corresponding Windows user name which will be mapped to the Linux user you just specified and provide a password to be used for share access. Click on OK.

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


Add a new Samba Shared Folder


Type or browse to the path you wish to share and enter a share name if you do not like the one provided by the tool. Set the Writable and Visible toggles to your desired settings and click OK. Select the Access' and either select a user added in the previous step,, or allow access to all users.

Click on OK when you have configured the information in this dialog. The main dialog should appear with the new share listed: <google>ADSDAQBOX_FLOW</google>


Fedora new share.jpg


Once completed, the folder you specified will be visible from any Windows systems on the same network (and workgroup specified in the Server Settings page) as your Fedora Linux system. You should now have remote access to your Linux folder from the Windows system.