Comments
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Cloud Computing
Conference & Expo
November 2-4, 2009 NYC
Register Today and SAVE !..

2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
In many cases, the end of the year gives you time to step back and take stock of the last 12 months. This is when many of us take a hard look at what worked and what did not, complete performance reviews, and formulate plans for the coming year. For me, it is all of those things plus a time when I u...
SYS-CON.TV
Linux on a corporate desktop Part 2: File sharing with Samba
How to install, configure, and use Samba.

(LinuxWorld) -- An hour before I deleted Windows 98 from my computer at work, I asked a colleague if she would oblige me to store some MP3s on her computer. I explained I was messing around with my computer, and wanted to store some songs in a safe spot. She said yes. (Thank you, Jen.) I navigated to her machine on the network, and dropped several gigabytes of music into her shared directory. As I completed this task, I noted how user-friendly Microsoft, and Apple for that matter, make local area networking.

Since my Linux workstation needed to converse with my coworker's Windows 9x computers on Microsoft's terms, I had some work to do. (See How to get Linux on your corporate desktop, Part 1 for the backstory on this saga.) If I could configure my Linux box to browse the network with the same ease that Windows and Macintosh users do, so much the better. Luckily, found two little applications that help us set up and take advantage of the monster called Samba, and allow us to poke around a local Windows domain and mount shared files. While it may seem frivilous to set up Windows-Linux filesharing to retrieve music, this exercise illustrates how easy it is to slip a Linux computer into a corporate network.

The first step is finding the Samba suite. Luckily, I use Slackware 8.0, which comes stock with Samba running like an Olympic track and field star. Most recent Linux distributions come with Samba. If your version does not, open a browser, navigate to www.google.com/linux and type "Samba" into the search query field. Freshmeat or Tucows will be near the top of the results. Kick around until you find the most recent version of Samba. As of this writing, the latest version is 2.2.3a. Download the tarball and save it to your home directory. That's right, I said tarball. Tar.gz. Definitely not the RPM. We're using source. We want to walk before we run.

"Okay," you say. "I've downloaded this file. What the heck do I do with it?"

"You compile and install it, silly."

Here's how:

  1. Open a terminal on your Linux machine.
  2. I prefer the gnome-terminal. Open your terminal, and navigate to the directory that contains the samba-2.2.3a.tar.gz file. This file is compressed. We need to de-compress it.

  3. Uncompress the tarball
  4. 2. Type gunzip samba-2.2.3a.tar.gz Don't expect any text output, because you aren't going to get any. This will replace the original file with a file called samba-2.2.3a.tar

  5. Un-tar the file
  6. Type: tar -xvf samba-2.2.3a.tar This will "un-pack" the archive, resulting in a new directory called samba-2.2.3a. Those switches we placed after the tar command, you know, the -xvf? The x means the program tar is going to eXtract the files from the archive. The v means tar is going to be Verbose about what it is doing to the archive. Simply put, you are going to see a bunch of lines scrolling down your terminal. These lines display all the files being extracted from the archive, and the path they are being extracted to. The f switch is weird. I am a bit unclear on what the f switch does. The tar man page tells me that it selects the device ARCHIVE, but that is all it says. This is a bit confusing. I use the f switch because that is how I learned to use tar. If you know what it does e-mail me with the answer.

    Now you can delete the .tar file, or save it in whichever directory you like to save .tar files.

    We have source code!

  7. Get where you need to go
  8. Change directories into the samba-2.2.3a directory. Type ls to view the contents of this directory.

    This is going to be fun.

    The very first action that should be performed when you get to this point with ANY source code is to read the README file. I like to use pico to read text files. You may prefer vi, jstar, or emacs. Pico is super quick and easy. Type pico README to read the README file. Read this file in its entirety.

    Since you learned so much reading the README documentation, you may be capable of completing the Samba install on your own. If this is the case, get on yer horse and start riding, although I welcome you to read along with the rest of us and walk through the process together.

  9. Change to the source directory
  10. This directory contains the Makefile. This directory also contains a script called configure.

  11. Run the configure script
  12. Type: ./configure This script checks your system for dependencies to make sure everything will compile correctly. This script takes a bit of time to complete. Be patient. When the configure script completes, it will return you to the command prompt.

  13. Compile!
  14. Type: make This command compiles all code and readies the Samba suite for final installation. make takes even longer than configure.

  15. Become root
  16. Type su, press ENTER, and enter the root password followed by a second ENTER. If you don't know, we just changed our user-status to root. We can now perform any action the root account has permissions to perform.

  17. Installation time
  18. It's time to install Samba. Type make install, sit back, and watch the final bit of output produced during the Samba install. This output is showing you where all the binary files, libs, man files, and other files are being placed throughout your file system.

  19. Link the libraries
  20. After make install, I like to enter the ldconfig command. Go ahead. Then type exit to return to your normal user account. That ldconfig command links the newly installed application to all of the correct lib files required to use said application.

  21. Smile
  22. Pat yourself on the back -- you just installed Samba from source.

    Samba configuration

    Before I can get my MP3s back and screamin' in my ears, I need to edit the smb.conf file. The smb.conf file is located in one of two places: the /etc directory, or the /etc/samba directory. I tend to place it in both directories. If something happens to one, I have a back-up in the bullpen.

    The smb.conf file is set up the same way as most config files. There are variables, and there are values. If the variable was IP ADDRESS the value would be YOUR.I.P.ADDRESS

    example:

    IP ADDRESS="YOUR.I.P.ADDRESS"

    Edit the file, go down through each variable, and enter the correct values for your specific network situation. I encourage you to manually edit this file and learn smb.conf's details.

    I have edited the smb.conf so many darned times -- I hate editing it -- I found a quick solution to this problem.

    GnoSamba configuration

    GnoSamba is a graphical interface for editing the smb.conf file. Search Freshmeat.com for gnosamba. Download the tarball. Compile and install the source:

    gunzip gnosamba-version.tar.gz
    tar -xvf gnosamba-version.tar
    cd gnosamba-version/
    pico README
    pico INSTALL
    ./configure
    make 
    su {root password}
    make install
    ldconfig
    exit

    Following the above commands should have GnoSamba installed in a jiffy.

    Now type gnosamba at the command line. Depending on your security restrictions, you may need to run this program as the "root" user to submit changes to the smb.conf file.

    The GUI will fly onto the screen. smb.conf begs to be configured.

    Click the File menu in the top-left hand corner of the GUI, then drop down to and select Open Configuration File.

    This action loads the current settings listed in smb.conf file. Services are listed on the left, parameters and values are listed on the right. Select the "Global" service on the left. On the right, you can double-click each parameter, and enter a new value to be associated with that parameter. Go ahead and change the "Workgroup" value to match your workgroup or domain on the Windows network. Go ahead and change all the values listed in smb.conf to match your particular network environment. There are far too many values for me to go every single one of them. If you don't know what changing one of the values will do, then leave it at its default. You can go back and read the smb.conf file for a better idea of what everything does.

    GnoSamba

    Once you are done changing all of the values in the smb.conf file, go ahead and click the menu-button titled "Write". This will finalize the changes to the smb.conf file. After you are done changing the configuration file, navigate to the "File" menu and select "Exit".

    Browsing the network

    Now that we have configured smb.conf, we may browse the network. After this, those MP3s will be mine!

    We need to go to www.google.com/linux, and search for an application called LinNeighborhood. LinNeighborhood is a great Samba front end, and is akin to the LinNeighborhood network browser bundled into the different Windows operating systems. It allows you to browse the network, and mount network shares in your filesystem. Once these network shares are mounted, you can treat them like any other directory in your filesystem. If configured, you can read and write to these mounted directories.

    Download the latest LinNeighborhood tarball. As of now, the latest version I could find was 0.6.4. Once downloaded, compile and install the application. Again:

    gunzip LinNeighborhood-version.tar.gz
    tar -xvf LinNeighborhood-version.tar
    cd LinNeighborhood-version/
    pico README
    pico INSTALL
    ./configure
    make 
    su
    {root password}
    make install
    ldconfig
    exit

    We have two more things to do before we can browse the network. Slackware 8.0 by default installs a kernel with smbfs loadable as a module. This smbfs is a type of network file system, and is a loadable module. This module technology is similar to a "driver" in the Windows environment. Modules need to be activated before they are of any use. To activate the smbfs module, become "root" and modprobe smbfs:

    su
    {root password}
    modprobe smbfs
    exit

    There won't be any output when you do this, but rest assured the module was loaded. It might be a good idea to set this module to be loaded at boot time. You can do this in the /etc/rc.d/rc.local script. Become "root", type pico /etc/rc.d/rc.local, and add modprobe smbfs to the bottom of the file. Make sure there is not a "#" symbol in front of this line. ctrl-x, y, and enter will save the file.

    Last thing: We need to make sure we will have permissions to mount the share. Mounting a share means to create a directory in your local file-system, which represents a directory on a remote machine.

    You must have the correct permissions to mount a remote share on your local filesystem. smbmount is responsible for mounting remote shares. smbmount actually calls upon smbmnt to mount the share to your file system. What we need to do is make smbmnt SUID root, so it is able to do its job.

    su
    {root password}
    chmod 4755 /usr/bin/smbmnt
    exit

    That's it.

    Ready, set, browse!

    Type LinNeighborhood and press enter to initialize the application. Next, go to the "Options" menu and select "preferences". Here you can specify your workgroup, along with your user name and password information for the workgroup. Save your changes and click "okay". Now, you can again go to the "Options" menu, and select "Browse entire network". This will bring up a dialogue box that asks if you want to browse as a different user. Decide which user you'd like to browse the network as, and click okay. This will scan the network, and display all of the available computers on the network. Click the "+" symbol next to each computer to expand that particular computer's shared directories.

    When you find a directory you'd like to browse, double-click that directory. Another dialogue box will appear. This dialogue box allows you to specify where in your file system you'd like to mount this share. You are also given the option of mounting the share as a different user. Remember where the default mount-point is. Click "mount". Now you can open your favorite file manager -- Slackware 8.0 comes with nautilus -- and browse the share. Finally! There are all my MP3s. Now I just copy them to the directory of my choice. Although it seems that they are on my hard drive, they are really housed on another machine on the network.

    You should poke around the rest of the menus in LinNeighborhood. Look at some of your options. It's a great program.

    Review

    We've accomplished quite a few things today. We learned how to install the Samba suite, how to install source code, the basics of configuring Samba, and how to browse the Windows network. We also learned how to load a module, add a line to the start-up script, and set a SUID of a file to root. I hope you had fun.
    About Nick Davis
    Nick Davis is an IDG.net and Linux.SYS-CON.com editor.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

SOA World Latest Stories
Quick Response (QR) codes are intended to help direct users quickly and easily to information about products and services, but they are also starting to be used for social engineering exploits. This article looks at the emergence of QR scan scams and the rising concern for users today....
The Chinese company that claims it owns the iPad trademark says it plans to seek a ban on iPad exports out of China, threatening global supplies. According to what a lawyer for Proview Technology (Shenzhen) Co Ltd told Reuters, the firm is petitioning Chinese customs to stop shipment...
Cisco Wednesday filed suit in the European Union’s second-highest court, the General Court in Luxembourg, challenging the European Commission’s rubber stamp last October of Microsoft’s $8.5 billion acquisition of Skype. Cisco says it isn’t opposed to the merger, but figures the EC sh...
2011 was a year of rapid adoption for public and private cloud services. Instant and on-demand server provisioning was the driving force behind the massive growth. On top, cloud server templates and script automation simplified application installation for simple and pre-defined applic...
As more enterprises are adopting clouds, the nature of cloud computing is changing. Previously, clouds were used to test applications or for non-mission critical applications. Today, enterprises are using clouds for cost-saving advantages and launching more mission critical application...
Building a cloud computing environment with on-demand access to compute, network, and storage resources requires an elastic infrastructure at multiple levels. Virtualization combined with x86 servers has transformed the way we scale out compute resources. Unfortunately, legacy Fibre Ch...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON Featured Whitepapers
ADS BY GOOGLE