Ero sivun ”Samba/en” versioiden välillä
(Ak: Uusi sivu: This share demands a Unix user to log in. Remove the number sign (#) from the start of the line:) |
|||
(22 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
Rivi 42: | Rivi 42: | ||
security = user | security = user | ||
− | + | Add this to the end of the file: | |
[jaon_nimi] | [jaon_nimi] | ||
− | path = / | + | path = /path/to/share/ |
browseable = yes | browseable = yes | ||
writeable = yes | writeable = yes | ||
− | valid users = | + | valid users = user |
− | admin users = | + | 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 | + | smbpasswd -a username |
− | + | Define ownership rights for the directory in question | |
− | chown -hR | + | chown -hR username /path |
− | + | 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 | ||
− | + | Test Samba's configurations: | |
testparm | 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. | |
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Setting !! Parameters !! Function !! Default |
|- | |- | ||
− | | admin users || ( | + | | admin users || (usernames) || Root users || Not defined |
|- | |- | ||
− | | valid users || ( | + | | valid users || (usernames) || Users which can connect to the share || Not defined |
|- | |- | ||
− | | invalid users || ( | + | | invalid users || (usernames) || Users which can't connect to the share || Not defined |
|- | |- | ||
− | | read list || ( | + | | read list || (usernames) || Users which only have read privileges, even if the share is writable || Not defined |
|- | |- | ||
− | | write list || ( | + | | write list || (usernames) || Users with write privileges || Not defined |
|- | |- | ||
− | | max connections || | + | | max connections || amount || Highest amount of simultaneous connections to share || 0 |
|- | |- | ||
− | | guest only (only guest) || yes/no || | + | | guest only (only guest) || yes/no || If yes, then only guest can access share || no |
|- | |- | ||
− | | guest account || | + | | guest account || username || Define who is "guest" || nobody |
|- | |- | ||
|} | |} | ||
Rivi 99: | Rivi 99: | ||
− | + | Example: For the user sara, matti and jussi privileges for a network share. The admin privilege belongs to antti. | |
− | [ | + | [share] |
− | path = /home/ | + | path = /home/share |
− | comment = | + | comment = Networkshare |
writable = yes | writable = yes | ||
valid users = sara antti jussi | valid users = sara antti jussi | ||
Rivi 109: | Rivi 109: | ||
− | + | Example: Only read privileges, but write privileges for matti and sara. | |
[sales] | [sales] | ||
− | path = /home/ | + | path = /home/share |
− | comment = | + | comment = Networkshare |
read only = yes | read only = yes | ||
write list = matti sara | write list = matti sara | ||
− | + | Example: For guests | |
− | [ | + | [share] |
− | path = /home/ | + | path = /home/share |
− | comment = | + | comment = Networkshare |
writable = yes | writable = yes | ||
guest ok = yes | guest ok = yes | ||
Rivi 127: | Rivi 127: | ||
guest only = yes | guest only = yes | ||
− | == | + | == Connecting to domain using samba == |
− | + | There is a separate guide on our wiki which discusses this: [[Linux AD liitos|Linux AD connection]] | |
− | == | + | == 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
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.
Sisällysluettelo
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
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
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