samba

Setting up a Linux home server based on a low cost and low power hardware (Pc Engines Alix) – Sharing USB disk with Samba – Part4

Now we will install SAMBA, the well known suite of programs for file and printer sharing.

We will provide a basic configuration for home users, with a share for files downloaded for example with Bittorent and home dir for each user.

Let’s install needed packages:

homeserver:~# apt-get install samba samba-common smbclient smbfs

We will configure the service later, leave the default value at the first question and answer “No” to the second.

Our configuration will be very easy, first of all remove the default configuration generated by debconf:

homeserver:~# mv /etc/samba/smb.conf /etc/samba/smb.conf.orig

Now we will create the directory that we will use for sharing downloaded files and we will add write permission to all (remember that we mount the USB disk as /data)

homeserver:~# mkdir /data/download
homeserver:~# chmod a+w /data/download

Now let’s create a private directory for the first of our users:

homeserver:~# mkdir /data/users_shares/

Now we need to edit the configuration file for Samba /etc/samba/smb.conf.
The file was renamed a few steps above and so now it’s empty, insert the following content:

[global]
workgroup = HOME
netbios name = FILESERVER
server string = Home Fileserver %v
map to guest = Bad User
log file = /var/log/samba/log.%m
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
preferred master = No
local master = No
dns proxy = No
security = User
# Sharing for downloaded files
[download]
path = /data/download
valid users = family
read only = No
create mask = 0777
directory mask = 0777
#Home shares for users
[homes]
path = /data/users_shares/%S
comment = Home Directories
browseable = no
valid users = %S
create mask = 0700
directory mask = 0700

Now we need to restart the Samba service to apply the new configuration.

homeserver:~# /etc/init.d/samba restart

Pay attention that the valid user required for the “download” share is “family”, so we need to create it:

homeserver:~# useradd -c “Family User” family
homeserver:~# smbpasswd -a family
New SMB password:
Retype new SMB password:
startsmbfilepwent_internal: file /etc/samba/smbpasswd did not exist. File successfully created.
Added user family.

We can now create the first user (in our example “user1″) with his own samba password:

homeserver:~# mkdir /data/users_shares/
homeserver:~# adduser

The wizard will prompt you for password and basic informations.
For example we created “user1″ and the directory “/data/users_shares/user1″
Now we need to se SMB password for the user:

homeserver:~# smbpasswd -a
New SMB password:
Retype new SMB password:
Added user .

You home server is now sharing the external USB disk!
From a Windows machine in your home network you can now map shares of your home server.

This is for example the command to view available shares via Windows command prompt (cmd.exe):

C:\Users\username> net view \\IP_Home_Server

And this is the command to map the network drive “download”:

C:\Users\username> net use * \\IP_Home_Server\download

In the next post we will install Bittorrent with a Web User Interface.

Tags: , , , , , , , , , , ,

Wednesday, August 19th, 2009 Debian Lenny, Home server, Linux, Voyage Linux No Comments
 

Categories

AskoziaPBX

Create your full features PBX IP with voicemail and Automated Attendant with alix2d3 or alix2d2 system board.

You can find the PBX IP preconfigured image here:


And obtain all support information "how to" here: