Mainos / Advertisement:

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

Kohteesta Taisto
Siirry navigaatioon Siirry hakuun
(Ak: Uusi sivu: [jako] path = /home/share comment = Networkshare writable = yes valid users = sara antti jussi admin users = antti)
(Ak: Uusi sivu: Example: Only read privileges, but write privileges for matti and sara.)
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]

Versio 11. elokuuta 2015 kello 07.28

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.

[jako]
      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/jako
      comment = Verkkokansio
      read only = yes
      write list = matti sara

Esimerkki: vierailijoille

[jako]
       path = /home/jako
       comment = Verkkokansio
       writable = yes
       guest ok = yes
       guest account = ftp
       guest only = yes

Samballa toimialueelle

Erillinen opas meiltä: Samban AD liitoksesta

Lähteet

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

Mainos / Advertisement: