Configuring Samba

Purpose:

To get Samba configured on a Linux machine, and mount it from a Windows machine.

Procedure:

You will need 2 machines that can communicate with each other over the network. One is the "server" running Linux and the other the "client" running Windows 7. Make sure both are on the green network.

On the Linux server, you will create a directory and share it with the world. On the client you will find the shared directory and mount it so that files can be read, written, added, and deleted there.

0. Before we get going with sharing files using Samba, use apt-get to install the packages samba and system-config-samba. Then, give your server a readable machine name. Each machine has a white sticker on it (the one I'm working on says pc1). We can do better.

Open up a terminal console and, as sudo, do leafpad /etc/hostname. Change the value is333 to is333-machname, where machname is the name on the white sticker on your server (or choose some other machine name -- be creative if you want). Save the file.

Now, reboot the server. (You can do this from the terminal by typing sudo reboot.) When you log in again, start up a terminal window and your shell should now say that you are mradmin on machine <your-chosen-name>.

1. On the server, under sudo, create a directory in /home. Give it some name you can easily recognize. E.g., 

sudo -s
(You'll get a warning here about being unable to resolve the hostname. Just ignore that.)
cd /home
mkdir normanscuteknees


In this new directory, which we'll call <yourdir>, create a simple file with something in it. We'll call this file <file1>.

Now, I could explain everything here, but instead, why don't you do what I did: follow this set of instructions on this page:

http://www.noobslab.com/2012/03/configure-samba-sharing-between-ubuntu.html

Only do the first part, where you allow access to the files on the Ubuntu machine from the Windows machine. If you have questions along the way, here are some hints/notes:

Q1: On the ubuntu machine, look at the ownership and file permissions of a file that you created on the Windows machine. What are they?

Q2: On the Windows machine, create a directory in the mounted file system. Can you see it on the Ubuntu machine? What is the ownership and file permissions?

Q3: What is the ownership and permissions on a file, according to the Windoze machine? (Right click on the file, choose Properties, then look at the Security tab.)

2. Remove the new directory and clean up.

Go to /home and do sudo rm -rf <yourdir>

Do sudo apt-get purge <the list of packages you installed earlier>

Reboot the machine.