Mainos / Advertisement:

Ero sivun ”Samba/en” versioiden välillä

Kohteesta Taisto
Siirry navigaatioon Siirry hakuun
(Ak: Uusi sivu: [share_name] comment = comment writable = yes (if you want to save something in this share) if you want to allow everybody to save in this share the...)
 
(24 välissä olevaa versiota samalta käyttäjältä ei näytetä)
Rivi 35: Rivi 35:
 
   public = yes
 
   public = yes
  
Suojattu jako:
+
Secured share:
 
   security = user
 
   security = user
  
Tämä vaatii että kirjautumiseen tarvitaan Unix käyttäjä. Ota risuaita (#) pois rivin alusta:  
+
This share demands a Unix user to log in. Remove the number sign (#) from the start of the line:  
  
 
   security = user
 
   security = user
  
Ja tämä tiedoston loppuun:
+
Add this to the end of the file:
  
 
   [jaon_nimi]
 
   [jaon_nimi]
   path = /polku
+
   path = /path/to/share/
 
   browseable = yes
 
   browseable = yes
 
   writeable = yes
 
   writeable = yes
   valid users = kayttaja
+
   valid users = user
   admin users = adminkayttaja
+
   admin users = administrator
  
Tallenna tiedosto ja sulje se.
+
Save the file and close it.
  
Luo Unix tunnuksellesi Samba tunnus. (Pitää olla sama tunnus ja salasanan on suositeltavaa olla sama)
+
Create a Samba login for your Unix user (must be the same username and we recommend using the same password).
  
   smbpasswd -a käyttäjänimi
+
   smbpasswd -a username
  
Määritä omistusoikeus kyseiselle kansiolle
+
Define ownership rights for the directory in question
  
   chown -hR käyttäjänimi /polku  
+
   chown -hR username /path  
  
Käynnistä lopuksi samba uudelleen
+
And restart the samba service
  
 
   service samba restart  
 
   service samba restart  
Rivi 67: Rivi 67:
 
   /etc/init.d/samba restart
 
   /etc/init.d/samba restart
  
Testaa Samban konfiguroinnit:
+
Test Samba's configurations:
  
 
   testparm
 
   testparm
  
=== Käyttöoikeudet verkkojakoon ===
+
=== Usage privileges for network share ===
  
Määritä Sambaan kenellä on oikeus lukea, kirjoittaa ja muokata verkkojaossa olevia tiedostoja. Muista myös määrittää tiedostojärjestelmälle sopivat käyttöoikeudet.
+
Define who has the privileges to read, write or modify the files in a network share. Also remember to define proper usage privileges for the filesystem.
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Asetus !! Parametrit !! Toiminto !! Oletus
+
! Setting !! Parameters !! Function !! Default
 
|-
 
|-
| admin users || (käyttäjänimet) || Root käyttäjät || Ei ole määritelty
+
| admin users || (usernames) || Root users || Not defined
 
|-
 
|-
| valid users || (käyttäjänimet) || käyttäjät jotka voi yhdistää jakoon || Ei ole määritelty
+
| valid users || (usernames) || Users which can connect to the share || Not defined
 
|-
 
|-
| invalid users || (käyttäjänimet) || käyttäjät joilta evätään oikeus jakoon || Ei ole määritelty
+
| invalid users || (usernames) || Users which can't connect to the share || Not defined
 
|-
 
|-
| read list || (käyttäjänimet) || käyttäjät jotka voivat vain lukea kirjoitettavaa jakoa || Ei ole määritelty
+
| read list || (usernames) || Users which only have read privileges, even if the share is writable || Not defined
 
|-
 
|-
| write list || (käyttäjänimet) || käyttäjät jotka voivat kirjoittaa jakoon johon ei normaalisti voi || Ei ole määritelty
+
| write list || (usernames) || Users with write privileges || Not defined
 
|-
 
|-
| max connections || lukumäärä || suurin määrä sallittuja yhteyksiä jakoon || 0
+
| max connections || amount || Highest amount of simultaneous connections to share || 0
 
|-
 
|-
| guest only (only guest) || yes/no || jos kyllä, niin vain guest pääsee jakoon || no
+
| guest only (only guest) || yes/no || If yes, then only guest can access share || no
 
|-
 
|-
| guest account || käyttäjänimi || määritellään kuka on guest || nobody
+
| guest account || username || Define who is "guest" || nobody
 
|-
 
|-
 
|}
 
|}
Rivi 99: Rivi 99:
  
  
Esimerkki: käyttäjälle sara, matti ja jussi oikeudet verkkojakoon. Järjestelmävalvojan oikeus kuuluu antille.
+
Example: For the user sara, matti and jussi privileges for a network share. The admin privilege belongs to antti.
  
  [jako]
+
  [share]
       path = /home/jako
+
       path = /home/share
       comment = Verkkojako
+
       comment = Networkshare
 
       writable = yes
 
       writable = yes
 
       valid users = sara antti jussi
 
       valid users = sara antti jussi
Rivi 109: Rivi 109:
  
  
Esimerkki: vain lukuoikeus, mutta matille ja saralle kirjoitusoikeus.  
+
Example: Only read privileges, but write privileges for matti and sara.  
  
 
  [sales]
 
  [sales]
       path = /home/jako
+
       path = /home/share
       comment = Verkkokansio
+
       comment = Networkshare
 
       read only = yes
 
       read only = yes
 
       write list = matti sara
 
       write list = matti sara
  
Esimerkki: vierailijoille
+
Example: For guests
  
  [jako]
+
  [share]
         path = /home/jako
+
         path = /home/share
         comment = Verkkokansio
+
         comment = Networkshare
 
         writable = yes
 
         writable = yes
 
         guest ok = yes
 
         guest ok = yes
Rivi 127: Rivi 127:
 
         guest only = yes
 
         guest only = yes
  
== Samballa toimialueelle  ==
+
== Connecting to domain using samba ==
  
Erillinen opas meiltä: [[Linux AD liitos|Samban  AD liitoksesta]]
+
There is a separate guide on our wiki which discusses this: [[Linux AD liitos|Linux AD connection]]
  
== Lähteet ==
+
== Sources ==
  
 
https://raymii.org/s/tutorials/SAMBA_Share_with_Active_Directory_Login_on_Ubuntu_12.04.html
 
https://raymii.org/s/tutorials/SAMBA_Share_with_Active_Directory_Login_on_Ubuntu_12.04.html

Nykyinen versio 11. elokuuta 2015 kello 07.31

Muut kielet:
English • ‎suomi

Samba is mainly known for it's file server properties, but it can also be used to add Linux machines to a domain. Samba can also be used to create domains, just like Active Directory Domain Services in Windows.

Installation

"Samba can be found on Debian installation DVD 1."

We install Samba from package manager:

 aptitude install samba

OR

 apt-get install samba

Samba's configuration file can be found under the path:

 /etc/samba/smb.conf

Network share in Samba

Open the samba configuration file

 nano /etc/samba/smb.conf

Public share (anonymous login):

To the end of the file:

 [share_name] 
 comment = comment
 writable = yes     (if you want to save something in this share) 
                     if you want to allow everybody to save in this share then remember you must give privileges (chmod 0777) 
 path = /path/to/share/
 public = yes

Secured share:

 security = user

This share demands a Unix user to log in. Remove the number sign (#) from the start of the line:

 security = user

Add this to the end of the file:

 [jaon_nimi]
 path = /path/to/share/
 browseable = yes
 writeable = yes
 valid users = user
 admin users = administrator

Save the file and close it.

Create a Samba login for your Unix user (must be the same username and we recommend using the same password).

 smbpasswd -a username

Define ownership rights for the directory in question

 chown -hR username /path  

And restart the samba service

 service samba restart 
 /etc/init.d/samba restart

Test Samba's configurations:

 testparm

Usage privileges for network share

Define who has the privileges to read, write or modify the files in a network share. Also remember to define proper usage privileges for the filesystem.

Setting Parameters Function Default
admin users (usernames) Root users Not defined
valid users (usernames) Users which can connect to the share Not defined
invalid users (usernames) Users which can't connect to the share Not defined
read list (usernames) Users which only have read privileges, even if the share is writable Not defined
write list (usernames) Users with write privileges Not defined
max connections amount Highest amount of simultaneous connections to share 0
guest only (only guest) yes/no If yes, then only guest can access share no
guest account username Define who is "guest" nobody


Example: For the user sara, matti and jussi privileges for a network share. The admin privilege belongs to antti.

[share]
      path = /home/share
      comment = Networkshare
      writable = yes
      valid users = sara antti jussi
      admin users = antti


Example: Only read privileges, but write privileges for matti and sara.

[sales]
      path = /home/share
      comment = Networkshare
      read only = yes
      write list = matti sara

Example: For guests

[share]
       path = /home/share
       comment = Networkshare
       writable = yes
       guest ok = yes
       guest account = ftp
       guest only = yes

Connecting to domain using samba

There is a separate guide on our wiki which discusses this: Linux AD connection

Sources

https://raymii.org/s/tutorials/SAMBA_Share_with_Active_Directory_Login_on_Ubuntu_12.04.html

Mainos / Advertisement: