Mainos / Advertisement:

Samba

Kohteesta Taisto
Versio hetkellä 11. elokuuta 2015 kello 07.27 – tehnyt Frans (keskustelu | muokkaukset) (Ak: Uusi sivu: {| class="wikitable" |- ! Setting !! Parameters !! Function !! Default |- | admin users || (usernames) || Root users || Not defined |- | valid users || (usernames) || Users which c...)
Siirry navigaatioon Siirry hakuun
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


Esimerkki: käyttäjälle sara, matti ja jussi oikeudet verkkojakoon. Järjestelmävalvojan oikeus kuuluu antille.

[jako]
      path = /home/jako
      comment = Verkkojako
      writable = yes
      valid users = sara antti jussi
      admin users = antti


Esimerkki: vain lukuoikeus, mutta matille ja saralle kirjoitusoikeus.

[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: