Sunday, January 07, 2007

SAMBA! Part 2, adding shares

This is the second part of the instructions for setting up samba (SMB) windows file sharing on Ubuntu Linux. You can go here for the first part, where we added samba and turned it on.

More instructions can be found here.
Open the terminal, and type this in:
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
English translation:
sudo = temporarily give me more user privileges
cp = copy 1 file to another file (in this case, we are copying smb.conf to
smb.conf_backup
so we can revert to the old settings if we need to).

If you did it right, the terminal will not give you any response.
If you want to check it, you can go to /etc/samba/ and make sure the two
files are there.

Now, we want to actually edit the smb.conf file:
gksudo gedit /etc/samba/smb.conf
This is one of the most surprising things about Linux, and I think it's
very telling. In windows, it's kind of every man for themselves -
each software company does things their own way, whichever way is
most cost effective for them.
In Linux, there are some fundamental conventions that programmers follow.
Usually, but not always, there is a small file that gives you tons
of features and minuscule control over every aspect of a program.
It is a simple text file that usually has a .conf extension.
Programmers could trust you to edit the source yourself, since most
programs are open source, but then you would have to redo all your
work every time you upgraded. It's simple, elegant, and very common.
Combined with man, .conf files are one of my favorite thigs about linux.

Find the "workgroup = MSHOME" line under global, and
change MSHOME to whatever the name of your workgroup is.

Find the "; security = user" line under Authentication, and change it to this:
" security = user
username map = /etc/samba/smbusers"
The semi-colon comments out the line so it doesn't work.
We want username authentication to work, and we also want to
map usernames to the smbusers file.

We need to make three changes in the share definitions section:

uncomment the
"[homes] comment = home directories browseable = no" lines
uncomment the "valid users = %s" line
Find "writeable = no" in the Share Definitions section,
and change it to yes.


save your changes, close smb.conf, and type
"sudo testparm" in the terminal.
Sudo testparm will test smb.conf and make sure everything is correct.

If you don't have any errors, you can restart samba with a
"sudo /etc/init.d/samba restart"
init.d is a text file that holds initialization and termination
files for many programs.
The above command basically asks the init daemon to stop and start
samba for you.

A daemon is a unix term for a program that runs unattended.

If you want to change the name that appears in your workgroup for
your new fileserver, open back up the smb.conf file and look
for the "server string" line. Change that line to whatever
you want. %s is the name of the computer you used during install.

Labels: , , , , , , ,

Wednesday, January 03, 2007

Samba! Or, how to install SMB (Server Message Block) (Windows) file sharing on Ubuntu Linux 6.10 Edgy Eft

More information on installing Samba can be found here.

The instructions sometimes tell you to use apt-get, but there are ocassionally bugs going back and forth between apt-get and the Synaptic package manager, so that's the way I am going to do it here. Besides, Synaptic is basically only a front end GUI for apt anyway.

#1
We are going to install samba (which is the linux version of windows network smb file sharing), which we want because we want to share files on the local network.
System - administration - synaptic
We might as well make sure we have everything updated.
reload - mark all upgrades
search for samba, mark it for upgrade, and do the same for SMBFS (samba is the program, and smbfs is the file system for samba). You should already have the samba common files installed, but add them if you don't.

#2
Open your terminal by going to:
Applications - Accessories - Terminal
Now we want to add at least one user to samba:

Code:

sudo smbpasswd -a system_username


English translation =
sudo (give me super user privileges temporarily)
-a add
system_username a username that already exists on your system

When you hit enter, it will ask you for a password. Enter one.

#3
Continuing to add a user to samba:
Code:

sudo gedit /etc/samba/smbusers



English translation =
sudo (give me super user privileges temporarily)
gedit open the program called gedit (which is a simple text editor)
/etc/samba/smbusers open the text file located here in gedit
Put the following line in the file:
system_username = "network username"
so, if your system_username from step #2 is BOB, and you want to use the samba network as BOB, then the line will look like this:
BOB = "BOB"
Save the file, and go back to your terminal

When you restart samba using this command:
Code:

sudo /etc/init.d/samba restart



you should be able to browse the new addition to your network.
Next time, we will actually set up samba to share files with windows machines.

Labels: , , , , , , ,

Tuesday, January 02, 2007

Install Day!

Right now I'm installing Ubuntu 6.10 (Edgy Eft).
My hardware is what is left over from my latest desktop build, most of the parts used to be in my old main desktop running windows XP.

These are the parts:
AMD Athlon XP 1800+ (1.533 mhz)
motherboard with an Nvidia chipset
766 MB ram
2 hard drives:
40 GB (boot, swap, /)
80 GB (storage)
Nvidia GeForce MX 64 MB video card


Old used parts, yes, but I don't mind. I'm doing this on the cheap.

That's pretty much all that's on the agenda for today, put the damn thing together, install Ubuntu Linux, and update!

This is how I updated:
Open Synaptic package manager
System - Administration - Synaptic package manager
Put in password
go to Settings - Repositories
Make sure universe and Multiverse are checked
(this will enable you to get all the update goodies, including updates and programs that might have more restrictive licenses than the GPL)
Hit reload
Hit mark all upgrades and then apply

It might just be a habit left over from working with windows machines, and you certainly don't have to do it, but at this point I like to do a reboot.

That's it for day 1.

Labels: , , , , , , , , , ,

Monday, January 01, 2007

cool as fsck

This blog is going to be a journal of my trials and tribulations with installing and hosting a website.

I kind of sort of know what I am doing, if I'm going to be honest.
I've installed and run Linux before, but I'm by far not a guru. Hopefully, this will help someone else out. This time I am going to use Ubuntu, because it's user friendly, even if it isn't that old there is lots of help info on the web for it, and I really really prefer a Debian style package management system. I've used Red Hat/fedora (it was my first distro) and Mandrake before, but I prefer Debian/Ubuntu.
There are three reasons I'm doing this:
1. I want a record of what I do to the machine and when I do it (what works and doesn't work)
2. Maybe that information can help someone else out
3. I've always wanted to do a blog, but never really had anything to write about before

I'm also going to write about other miscellaneous things along the way. Hopefully, I can post at least a few times a week!

Labels: , , , , , , , , , ,