Wednesday, February 24, 2016

The Netbook Server - How to Actually Share Part Of The Hard Drive

First, you installed Linux to a RaspberryPi or a Netbook, or whatever you had on hand.

Second, you made it so you could look into that machine from anywhere on your network.

If all you wanted was a taste of how to run Linux and have fun with all those free goodies there, you could have stopped.  Now I'm going to show you how to take a part of the hard drive (a folder) and share it out to the network.

Why?

So you can copy your pictures/recipes/important crap somewhere else.
So you can back up your computer across the network.
So you can brag to the co-workers that you have a proper Linux Home Server and sound like you know what you're doing.

Well the deal is that it took me a half hour to do this last night.  I was distracted by what was on the TV so it would have taken less time.

I did this on a RaspberryPi first.

Since my instructions were written there I then repeated the steps on my Netbook running Debian, so the instructions work.  It also works on anything derived from Debian Linux, so that if you have found this article using Linux Mint, Ubuntu, or any of the other derivatives from the Debian Family, you SHOULD be able to get this working with very little fuss.

If you are familiar with Linux and the way things work, you're used to finding instructions that promise to do something, get totally frustrated that the instructions are geeked out, and then realize that while it's working you don't actually understand WHY things are done this way.

I'm going to attempt to do it differently.  This way when I have to look at it later, I can look at my own B.S. here and say "Oh yeah, I remember this".

The information you need:

1) Your sign on name - this will be written assuming you are "bill".  Just change that to your own name from when you created the machine.

2) Your "root" and regular user (bill) Passwords.  

3) The name you gave the computer when you installed Linux.  It could be pi or rudolph or any other name you came up with.  


I will make assumptions and try to explain it all away.  Don't worry, I followed these same steps last night and the server now "serves" files out to the network.  As long as your network has a firewall, your stuff is safe.


---


Get the machine "up to date":

  1. Start your Terminal from the start menu.
  2. su and hit enter - Get "root" by giving it the root password.
  3. apt-get update - pull down all the headers of new stuff since the last time you got on the machine
  4. apt-get upgrade  - actually get all the upgraded software

Answer yes or Y to the prompt asking if you really want to update things, go make yourself something from the kitchen and come back in a bit.  It may take time.  There are always updates.  But if you never make changes to your "Repositories" on Debian or Raspbian, you are safe and free from any nasty viruses.


---


Get the Server Software Installed:

You'll be shocked how little has to be done here.   The server software is called SAMBA.  You know, like the great music from Brazil?   The current name has been made less fun - CIFS.  People tend to say it as "Siffs".

Geeks.

One line gets the software.  In terminal from the last part, as root enter the next line:

apt-get install samba samba-common-bin

---

Configure the Server Software:

You have to roll up your sleeves here.  You are actually going to change a text file, but I'm going to give you the information.  Remember - I am entering it as "bill".  If you are on RaspberryPi, your regular user will most likely be "pi".    Change "bill" to what you need it to be.

Second, a comment starts with a hash tag.  #

1) In terminal where you are signed on as "root", enter the following line to get into the "Nano" editor:

nano /etc/samba/smb.conf  

2) Find the line with "wins support" and change the line to read:

wins support = yes

3) Find "Share Definitions".  You are going to enter in a block of text.  Remember to change the path from "bill" to match your login name.

[Downloads]
    comment = Downloads Directory
    path = /home/bill/Downloads    
    browseable = no    

    writeable = yes
    only guest = no
    create mask = 0770
    directory mask = 0770
    public = no


#browseable limits logins to only see this directory and what is created there.  "yes" shares everything.

4) ctrl+x to exit, type y to save the file, then enter to get yourself back out to the root terminal prompt.

5) add a Samba user to be able to share that directory.  In terminal enter the following:

smbpasswd -a bill

Enter in a password, then enter it in again.  This is the password you will need to have to be able to get at the files from out on the network on another machine.  You will log in as (bill) and (password) from that other machine when you try to get there using File Manager.  Same thing with Mac or Linux.  They all need that password.

Write down your password.  I recommend using the same as your regular user password.  If you made them all the same as the Root password, well that may be easier.  You can also leave it blank, but I do not recommend that.  In fact, forget I mentioned it (or not...).

6) restart the computer

---



At this point, the netbook server is now visible on the network.  It is sharing the default login's "Downloads" directory. 

If you go into File Manager in Windows, you will be able to get to the files that are stored in the netbook's /home/bill/Downloads directory from any other machine on the network as long as you know the default user's login.  It will ask you for user and password.

If you have followed this, you can use the computer's name from when you created it.  I now have two servers "rudolph" for the netbook and the raspberryPi.  If computer names aren't your thing, you can also find them via IP addresses.

But at this point you have a functioning File Server.

You're done.  Next time it's getting this machine to serve out files from an external drive that you plugged in.


No comments:

Post a Comment