Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
home_server:home_server_setup:other_services:samba [2021-12-28 Tue wk52 11:01] – baumkp | home_server:home_server_setup:other_services:samba [2023-04-30 Sun wk17 17:43] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{tag> | ||
======samba====== | ======samba====== | ||
+ | I have not look at samba much since I first attempted to set up my home sever circa 2011 on Fedora before I moved to Ubuntu. | ||
+ | Samba seems to pretty much just work. I was lazy and tended to just use Webmin to set this up. However as I did not use Webmin for much else I have elected to to set it up now that I moved my server to Debian. | ||
+ | Samba is pretty much mandatory, as a lot of services smb use it as default.\\ | ||
+ | My main form of security it to limit external access to my lan, hence samba security is low. More focused on easy use.\\ | ||
+ | ====samba basic setup==== | ||
+ | High level requirements: | ||
+ | * To install: '' | ||
+ | * Adjust the smb.conf file: '' | ||
+ | * Add and enable users: '' | ||
+ | ++++smb.conf| | ||
+ | < | ||
+ | # Sample configuration file for the Samba suite for Debian GNU/Linux. | ||
+ | # | ||
+ | # | ||
+ | # This is the main Samba configuration file. You should read the | ||
+ | # smb.conf(5) manual page in order to understand the options listed | ||
+ | # here. Samba has a huge number of configurable options most of which | ||
+ | # are not shown in this example | ||
+ | # | ||
+ | # Some options that are often worth tuning have been included as | ||
+ | # commented-out examples in this file. | ||
+ | # - When such options are commented with ";", | ||
+ | # differs from the default Samba behaviour | ||
+ | # - When commented with "#", | ||
+ | # behaviour of Samba but the option is considered important | ||
+ | # enough to be mentioned here | ||
+ | # | ||
+ | # NOTE: Whenever you modify this file you should run the command | ||
+ | # " | ||
+ | # errors. | ||
- | <- home_server: | + | # |
+ | |||
+ | [global] | ||
+ | |||
+ | ## Browsing/ | ||
+ | |||
+ | # Change this to the workgroup/ | ||
+ | | ||
+ | |||
+ | # server string is the equivalent of the NT Description field | ||
+ | server string = %h server (Samba, Debian) | ||
+ | | ||
+ | # Windows Internet Name Serving Support Section: | ||
+ | # WINS Support - Tells the NMBD component of Samba to enable its WINS Server | ||
+ | # wins support = no | ||
+ | |||
+ | # WINS Server - Tells the NMBD components of Samba to be a WINS Client | ||
+ | # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both | ||
+ | ; wins server = w.x.y.z | ||
+ | |||
+ | # This will prevent nmbd to search for NetBIOS names through DNS. | ||
+ | dns proxy = no | ||
+ | |||
+ | #### Networking #### | ||
+ | |||
+ | # The specific set of interfaces / networks to bind to | ||
+ | # This can be either the interface name or an IP address/ | ||
+ | # interface names are normally preferred | ||
+ | ; | ||
+ | |||
+ | # Only bind to the named interfaces and/or networks; you must use the | ||
+ | # ' | ||
+ | # It is recommended that you enable this feature if your Samba machine is | ||
+ | # not protected by a firewall or is a firewall itself. | ||
+ | # option cannot handle dynamic or non-broadcast interfaces correctly. | ||
+ | ; bind interfaces only = yes | ||
+ | |||
+ | #### Debugging/ | ||
+ | |||
+ | # This tells Samba to use a separate log file for each machine | ||
+ | # that connects | ||
+ | log file = / | ||
+ | |||
+ | # Cap the size of the individual log files (in KiB). | ||
+ | max log size = 1000 | ||
+ | |||
+ | # If you want Samba to only log through syslog then set the following | ||
+ | # parameter to ' | ||
+ | # | ||
+ | |||
+ | # We want Samba to log a minimum amount of information to syslog. Everything | ||
+ | # should go to / | ||
+ | # through syslog you should set the following parameter to something higher. | ||
+ | | ||
+ | |||
+ | # Do something sensible when Samba crashes: mail the admin a backtrace | ||
+ | panic action = / | ||
+ | |||
+ | ####### Authentication ####### | ||
+ | |||
+ | # Server role. Defines in which mode Samba will operate. Possible | ||
+ | # values are " | ||
+ | # domain controller", | ||
+ | # directory domain controller" | ||
+ | # | ||
+ | # Most people will want " | ||
+ | # Running as " | ||
+ | # running " | ||
+ | # new domain. | ||
+ | | ||
+ | |||
+ | # If you are using encrypted passwords, Samba will need to know what | ||
+ | # password database type you are using. | ||
+ | | ||
+ | |||
+ | obey pam restrictions = yes | ||
+ | |||
+ | # This boolean parameter controls whether Samba attempts to sync the Unix | ||
+ | # password with the SMB password when the encrypted SMB password in the | ||
+ | # passdb is changed. | ||
+ | unix password sync = yes | ||
+ | |||
+ | # For Unix password sync to work on a Debian GNU/Linux system, the following | ||
+ | # parameters must be set (thanks to Ian Kahan << | ||
+ | # sending the correct chat script for the passwd program in Debian Sarge). | ||
+ | | ||
+ | | ||
+ | |||
+ | # This boolean controls whether PAM will be used for password changes | ||
+ | # when requested by an SMB client instead of the program listed in | ||
+ | # ' | ||
+ | pam password change = yes | ||
+ | |||
+ | # This option controls how unsuccessful authentication attempts are mapped | ||
+ | # to anonymous connections | ||
+ | map to guest = bad user | ||
+ | |||
+ | ########## Domains ########### | ||
+ | |||
+ | # | ||
+ | # The following settings only takes effect if ' | ||
+ | # classic domain controller', | ||
+ | # or ' | ||
+ | # | ||
+ | |||
+ | # It specifies the location of the user' | ||
+ | # profile directory from the client point of view) The following | ||
+ | # required a [profiles] share to be setup on the samba server (see | ||
+ | # below) | ||
+ | ; logon path = \\%N\profiles\%U | ||
+ | # Another common choice is storing the profile in the user's home directory | ||
+ | # (this is Samba' | ||
+ | # logon path = \\%N\%U\profile | ||
+ | |||
+ | # The following setting only takes effect if ' | ||
+ | # It specifies the location of a user's home directory (from the client | ||
+ | # point of view) | ||
+ | ; logon drive = H: | ||
+ | # logon home = \\%N\%U | ||
+ | |||
+ | # The following setting only takes effect if ' | ||
+ | # It specifies the script to run during logon. The script must be stored | ||
+ | # in the [netlogon] share | ||
+ | # NOTE: Must be store in ' | ||
+ | ; logon script = logon.cmd | ||
+ | |||
+ | # This allows Unix users to be created on the domain controller via the SAMR | ||
+ | # RPC pipe. The example command creates a user account with a disabled Unix | ||
+ | # password; please adapt to your needs | ||
+ | ; add user script = / | ||
+ | |||
+ | # This allows machine accounts to be created on the domain controller via the | ||
+ | # SAMR RPC pipe. | ||
+ | # The following assumes a " | ||
+ | ; add machine script | ||
+ | |||
+ | # This allows Unix groups to be created on the domain controller via the SAMR | ||
+ | # RPC pipe. | ||
+ | ; add group script = / | ||
+ | |||
+ | ############ | ||
+ | |||
+ | # Using the following line enables you to customise your configuration | ||
+ | # on a per machine basis. The %m gets replaced with the netbios name | ||
+ | # of the machine that is connecting | ||
+ | ; | ||
+ | |||
+ | # Some defaults for winbind (make sure you're not using the ranges | ||
+ | # for something else.) | ||
+ | ; idmap uid = 10000-20000 | ||
+ | ; idmap gid = 10000-20000 | ||
+ | ; | ||
+ | |||
+ | # Setup usershare options to enable non-root users to share folders | ||
+ | # with the net usershare command. | ||
+ | |||
+ | # Maximum number of usershare. 0 (default) means that usershare is disabled. | ||
+ | ; | ||
+ | |||
+ | # Allow users who've been granted usershare privileges to create | ||
+ | # public shares, not just authenticated ones | ||
+ | | ||
+ | |||
+ | # | ||
+ | |||
+ | # Un-comment the following (and tweak the other settings below to suit) | ||
+ | # to enable the default home directory shares. This will share each | ||
+ | # user's home directory as \\server\username | ||
+ | ;[homes] | ||
+ | ; | ||
+ | ; | ||
+ | |||
+ | # By default, the home directories are exported read-only. Change the | ||
+ | # next parameter to ' | ||
+ | ; read only = yes | ||
+ | |||
+ | # File creation mask is set to 0700 for security reasons. If you want to | ||
+ | # create files with group=rw permissions, | ||
+ | ; | ||
+ | |||
+ | # Directory creation mask is set to 0700 for security reasons. If you want to | ||
+ | # create dirs. with group=rw permissions, | ||
+ | ; | ||
+ | |||
+ | # By default, \\server\username shares can be connected to by anyone | ||
+ | # with access to the samba server. | ||
+ | # Un-comment the following parameter to make sure that only " | ||
+ | # can connect to \\server\username | ||
+ | # This might need tweaking when using external authentication schemes | ||
+ | ; valid users = %S | ||
+ | |||
+ | # Un-comment the following and create the netlogon directory for Domain Logons | ||
+ | # (you need to configure Samba to act as a domain controller too.) | ||
+ | ; | ||
+ | ; | ||
+ | ; path = / | ||
+ | ; guest ok = yes | ||
+ | ; read only = yes | ||
+ | |||
+ | # Un-comment the following and create the profiles directory to store | ||
+ | # users profiles (see the "logon path" option above) | ||
+ | # (you need to configure Samba to act as a domain controller too.) | ||
+ | # The path below should be writable by all users so that their | ||
+ | # profile directory may be created the first time they log on | ||
+ | ; | ||
+ | ; | ||
+ | ; path = / | ||
+ | ; guest ok = no | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | |||
+ | [printers] | ||
+ | | ||
+ | | ||
+ | path = / | ||
+ | | ||
+ | guest ok = no | ||
+ | read only = yes | ||
+ | | ||
+ | |||
+ | # Windows clients look for this share name as a source of downloadable | ||
+ | # printer drivers | ||
+ | [print$] | ||
+ | | ||
+ | path = / | ||
+ | | ||
+ | read only = yes | ||
+ | guest ok = no | ||
+ | # Uncomment to allow remote administration of Windows print drivers. | ||
+ | # You may need to replace ' | ||
+ | # admin users are members of. | ||
+ | # Please note that you also need to set appropriate Unix permissions | ||
+ | # to the drivers directory for these users to have write rights in it | ||
+ | ; write list = root, @lpadmin | ||
+ | |||
+ | [home] | ||
+ | writeable = yes | ||
+ | path = /home | ||
+ | |||
+ | [shared] | ||
+ | path = / | ||
+ | writeable = yes | ||
+ | |||
+ | [KarlData] | ||
+ | writeable = yes | ||
+ | path = / | ||
+ | |||
+ | [media2] | ||
+ | path = / | ||
+ | writeable = yes | ||
+ | |||
+ | [media1] | ||
+ | path = / | ||
+ | writeable = yes | ||
+ | |||
+ | [deluge] | ||
+ | path = / | ||
+ | writeable = yes | ||
+ | </ | ||
+ | ++++ | ||
+ | ====samba check commands==== | ||
+ | Some samba check commands: | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | ====Links==== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | ---- | ||
+ | |||
+ | <- home_server: |