Quick guide to config a samba server on debian to share files between windows and linux

It comes handy to setup samba server on a linux computer, for example: debian, and from there you will be able to share files to windows, the linux computer could be used as a windows computer provide file share. And you can access directory structure from a windows explorer:

access linux directory through samba from windows explorer

access linux directory through samba from windows explorer

There is already a great step by step guide here: http://www.unixmen.com/standalone-samba-in-debian-squeeze/

For me, I know the general idea and only need a quick reference to go for, so I listed a shorten steps below:
Install:
apt-get install samba

Edit the config file:
emacs /etc/samba/smb.conf

Add the content below to the end of the file:
[website]
comment = website
path = /website
valid users = @root
create mask = 0744
directory mask = 0744
writable = yes

Add username to samba:
smbpasswd -a root

Looks like it is required to add your username to samba’s own tracked list of allowed users: (of course you can add other users instead of root in your linux server, I use root here because I only want to setup a test machine for develop purpose)

Restart the server:
/etc/init.d/samba restart

That’s it, follow this quick list, you will be able to start a samba in 2 minutes for some quick use. But if you are looking for serious use, you’d better read&understand each config item in the manual.

Last by not least, an even short copy&paste block for you to make a quick start:

apt-get install samba
emacs /etc/samba/smb.conf

[website]
comment = website
path = /website
valid users = @root
create mask = 0744
directory mask = 0744
writable = yes

smbpasswd -a root
/etc/init.d/samba restart

Leave a Reply