Saturday, October 9, 2010

SAMBA - QUICK HOWTO part 2

In this short tutorial I will show you how to create a user based share on a samba server.

First, Install samba server:

apt-get install samba


Start the samba service:

/etc/init.d/samba start

Check service is running and bound to port 139:

lsof -i :139

COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
smbd    14942 root   23u  IPv6  18189      0t0  TCP *:netbios-ssn (LISTEN)


Add a samba user that will access the shared folder (you'll be prompted for password):

smbpasswd -a tango

The main configuration file sits at:

/etc/samba/smb.conf

Open it with your favourite text editor

We will add a share for the user tango, the share is located at:

/usr/srv/www/tangodomain

The share will look like this:
[tango share]
comment =tango's stuff
writeable = yes
path = /usr/srv/www/tangodomain
 
valid users = tango

Hup samba so changes take effect:

killall -HUP samba


Now, you can access the samba server from any Windows station as tango.

\\samba-serv\tango


You can map a network drive from Windows to make access more comfortable, from your Windows machine run:

C:\net use x: \\samba-serv\tango

No comments: