Samba
From CLUG Wiki
This is a new page, and might contain technically incorrect information. Please use at your own risk. If you are able to correct any errors or expand this document, please do so.
Contents |
Basic file sharing with Samba
What is Samba?
Samba is the Unix implementation of the SMB protocol. It allows you to easily share files and printers across Linux, Windows, FreeBSD, Solaris, BeOS and other operating systems. It's open-source software, and widely available. It has also built up a reputation for being extremely fast and stable.
Installing Samba:
Samba is included with almost every distribution.
Debian / Ubuntu:
#apt-get install smb smbclient libsmbclient
Mandrake:
#urpmi samba
Red Hat/Fedora:
The easiest way is probably to use the Red Hat package manager. To do it from the command line:
If you have YUM installed:
#yum install smb-package-name
If you have APT4RPM installed:
#apt-get install smb-package-name
Editing the smb.conf file
As root (or sudo-root), start up your favourite text editor (such as gedit, mcedit, vi, emacs, kate), and open up the smb.conf file. This can be found at /etc/samba/smb.conf
[global] workgroup = clugland security = share [mp3] path = /data/music public = yes writable = no browsable = yes
The listing below is just a bit of extract. Your actual smb.conf file will probably be much bigger in real life. Lines that start with a "#" or a ";" are comments, and are ignored by Samba. Options that apply to all shares are listed under the '[global]' section. Your workgroup is set by the workgroup directive, and for basic sharing, share level access is by far the simplest. In the example above, [mp3] is a shared "drive". The path directive tells samba where the directory is that we want to share. We make it public so that anyone can see it, we block write access, and make the share browsable over the smb network. This means that if a Windows user clicks on "My Network Places", they will be able to see the network share. Linux users will be able to access it just as easy using smbclient, konqueror or GNOME's network servers icon.
Creating a share from Ubuntu
You need to install SAMBA or NFS
$ sudo apt-get install samba
Click on System -> Administration -> Shared Folders, and add a new shared folder there.
