
One of the most common ways to network Kubuntu™ and Windows™ computers is to configure Samba as a file server. This section covers setting up a Samba server to share files with Windows™ clients.
Server će biti konfigurisan za dijeljenje fajlova sa bilo kojim klijentom na mreži bez potrebe za pasvordom.Ako okruženje zahtijeva strože kontrole pristupa, vidi the section called “Osiguravanje Samba fajla i print servera.”.
The first step is to install the Samba package. From a terminal prompt, enter:
sudo apt-get install samba
That's all there is to it. Samba is ready to be configured for file sharing.
The main Samba configuration file is located in /etc/samba/smb.conf
. The default configuration file has a significant number of comments in order to document various configuration directives.
Note
Not all of the available options are included in the default configuration file. See the smb.conf
man page or the Samba HOWTO and Reference Guide for more details.
Edit the following key/value pairs in the [global] section of
/etc/samba/smb.conf
:workgroup = EXAMPLE ... security = user
sigurnost parametar je dalje prema dolje u [global] sekciji, i komentirana je vani po defaultu. Promijenite PRIMJER tako da se poklapa sa trenutnim okruženjem.
Kreiraj novu sekciju na dnu datoteke, ili dekomentuj jedan od primjera za direktoriji koji treba da se dijeli:
[share] comment = Ubuntu File Server Share path = /srv/samba/share browsable = yes guest ok = yes read only = no create mask = 0755
komentar: je kratak opis dijeljenja. Podesite da postavi na odgovarajući način.
put:put do direktorija za dijeljenje.
This example uses
/srv/samba/sharename
because, according to the Filesystem Hierarchy Standard (FHS), /srv is where site-specific data should be served. Technically, Samba shares can be placed anywhere on the filesystem as long as the permissions are correct, but adhering to standards is recommended.browsable: enables Windows™ clients to browse the shared directory using Windows™ Explorer.
gost ok: dopušta klijentu da se uveže za dijeljenje bez unosa šifre.
read only: određuje ako je dijeljenje samo za čitanje ili su privilegije za pisanje odobrene.Privilegije za pisanje su omogućene jedino kad je vrijednost no,kao što je viđeno u primjeru.Ako je vrijednost yes,onda pristup dijeljenju je jedino za čiatnje.
create mask: određuje koje dozvole će imati novi fajlovi pri kreiranju.
Now that Samba is configured, the directory needs to be created and the permissions changed. From a terminal, enter:
sudo mkdir -p /srv/samba/share sudo chown nobody.nogroup /srv/samba/share/
Note
Prekidač -p govori mkdir da kreira cijelo direktorij stablo ako već ne postoji.Promijeni dijeljeno ime da bi se uklopilo u okolinu.
Finally, restart the Samba services to enable the new configuration:
sudo /etc/init.d/samba restart
Warning
Iznad konfiguracija daje sav pristup ka bilo kojem korisniku na lokalnoj mreži.Za više sigurnosnih konfiguracija,pogledaj the section called “Osiguravanje Samba fajla i print servera.”.
From a Windows™ client, it should now be possible to browse to the Kubuntu™ file server and see the shared directory. To check that everything is working, try creating a directory from Windows™.
To create additional shares, simply create new [dir] sections in /etc/samba/smb.conf
, and restart Samba. Make sure that the directory to be shared actually exists and that the permissions are correct.
For in depth Samba configurations see the Samba HOWTO and Reference Guide
The guide is also available in printed format.
O'Reilly's Using Samba, 3rd Edition is another good reference.