6.1.3. How to Setup a Samba ServerΒΆ

Introduction

When using a Virtual machine you may share files & folders via the Share Foldr feature of that partoicular Virtual Machine.  Another alternative, especially if you are using a dedicated Linux host, is to configure a Samba server on your Linux host.

Samba allows a host to interact with a Microsoft Windows client or server as if it is a Windows file and print server. In other words, if you are installing software on a Windows machine, you can easily transfer/modify files to the host machine by accessing it (the host machine) through windows.

Installing a Samba Server

1.  Samba can be installed by opening a terminal. (Applications -> System Tools -> Terminal)

2.  Switch to root user by typing su and entering the password you set during the install.

  1. On Fedora install Samba with the yum command: system-config-samba
    On Ubuntu install Samba using:  sudo apt-get install system-config-samba
  1. Open the Samba GUI (System -> Administration -> Samba).
  2. Configure the share
../../../_images/Samba_Server_Configuration_001.png
  • Click on “Add Share”
  • Specify the directory you want to share. For example, /home/<username>
../../../_images/Create_Samba_Share_002.png
  • Check both the Writable and Visable boxes
  • On the “Access” tab, select the Allow access to everyone option
../../../_images/Create_Samba_Share_003.png
  • Select “OK”
  1. Set up the workgroup
  • From the toolbar, select Preferences -> Server Settings
../../../_images/Server_Settings_004.png
  • Specify the “Workgroup” to match the workgroup on your Windows environment
  • Select “OK”
  1. Add a user
  • From the toolbar, select Preferences -> Samba Users
  • Click “Add User”
  • From the “Unix Username” dropdown box, select the username you set up
  • In the “Windows Username” and password boxes, enter the Unix Username and password for that user, respectively.
  • Select “OK”
  1. Turn off the firewall
  • System -> Administration -> Firewall
  • Select the “Disable” button

NOTE - If you are within your company’s firewall you may need to configure the network proxy.

  1. Enable the Samba and NFS services
  • System -> Administration -> Services  (NOTE - Not available in Ubuntu 10.04 LTS.  However the Samba service should start automatically)
  • Enable the services by browsing through the list on the left and locating nfs and smb. If they are not already enabled, enable them by clicking the “Enable” button.
  1. Test the configuration
  • From a terminal on the Linux workstation, type the command <prompt> ifconfig and note the IP address
  • From your Windows machine, go to Start -> Run and type \\<IP_ADDR> replacing <IP_ADDR> with the IP address of the Linux system