/var/lib/samba/private/secrets.tdb
Flag | For root only | Usage |
---|---|---|
-a kevin | yes |
kevin must already exist in the system password file : /etc/password
|
-d kevin | yes | disable kevin in the local password file |
-e kevin | yes | enable kevin in the local password file |
-x kevin | yes | delete kevin from the local password file |
-s | no | makes smbpasswd silent :
|
[global] min protocol = SMB2 client min protocol = SMB2Depending on Samba version (/usr/sbin/samba --version, or dpkg -l samba) and Windows version, see server min protocol and server max protocol.
Flag | Default value | Level | Usage |
---|---|---|---|
allow insecure wide links | No | global | see wide links and unix extensions |
browseable | Yes | service |
|
client max protocol | SMB3_11 |
global | the highest protocol level that will be supported by the client (details) |
client min protocol | SMB2_02 |
global | the minimum protocol version that the client will attempt to use (details) |
create mask | 0744 |
service | default permissions for new files |
directory mask | 0755 |
service | default permissions for new directories |
follow symlinks | Yes | service | (pretty explicit)
|
force user | (empty) | service |
|
guest ok | No | service | when set to yes, no password is required to connect to the share. Privileges will be those of the guest account. |
hosts allow | (empty) = everybody |
|
|
log file | (no default value) | global |
|
logging | (empty) | global |
|
path | (empty) | service | directory to which the user of the service is to be given access |
read only | Yes | service |
|
server max protocol
max protocol |
SMB3 |
global | the highest protocol level that will be supported by the server |
server min protocol
min protocol |
SMB2_02 |
global | the minimum protocol version that the server will allow the client to use |
unix extensions | Yes | global |
|
wide links | No | service |
|
valid users | empty, meaning everyone is valid |
service | comma -separated list of users who are allowed to use this service |
workgroup | WORKGROUP | global | The workgroup the Samba server will appear to be in when queried by clients.
Looks like this "workgroup" thing comes from the past and is not necessary anymore (with SMB2+ / Win10) https://superuser.com/questions/1554784/samba-configuration-on-rhel-8-2-smb1-disabled-no-workgroup-available https://askubuntu.com/questions/1265923/configuring-20-04-samba-for-smbv1 |
writable | No | service | see read only |
Share Definitions
sections of the configuration file (details).[global]
section onlyservicesection or in the
[global]
section. When used in the [global]
section, the parameter value applies to all services.The Samba suite includes a number of different programs. Some of them operate in a client mode, others are server daemons. This suggests the client min protocol and client max protocol directives are mostly pointless when configuring up a file server (otherwise they would duplicate + conflict with their "server" counterparts : server min protocol and server max protocol).
# (explicit) follow symlinks = yes # allows following symlinks outside of the shared directory wide links = yes # related to uid/gid between server and client, but also collides with 'wide links' above when enabled unix extensions = no
option = value # this is a comment DON'T DO THAT !!!
hosts allow = myLaptop DON'T DO THAT !!!
Found this in old notes, not sure this is still true / useful :If you just want to setup a network share with no special permissions (easiest but lowest security level), you just have to
- switch from security = user to security = share
- "chmod 777" the shared directory
Version 4.5.12-Debian
[global] hosts allow 192.168.56.1 interfaces = eth0 bind interfaces only = yes
Share Definitions
sectionThat's about it for a functional means to share files. The only "security" feature here is that it only allows 1 host, identified by its IP address. This is VERY POOR and only suited for temporary configuration, like while debugging other stuff !!!
[myShare] force user = kevin create mask = 0700 directory mask = 0700
Action | Linux | FreeBSD |
---|---|---|
setup | apt install samba | Samba is available in the FreeBSD ports at /usr/ports/net/samba. A simple make install + make clean and it should work. |
configuration file | /etc/samba/smb.conf | /usr/local/etc/smb.conf |
check configuration | testparm | /usr/local/bin/testparm -s |
start / stop / restart / status commands | systemctl start/stop/restart/status smbd.service | |
Logs | 1 file per client machine : /var/log/samba/log.sambaClient |
Samba is based on the Microsoft SMB protocol for sharing files and printers. It seems that, historically, since the FATxx filesystems had limitations on file size, the same occurred on SMB. Sometimes, Unix clients can't use some of these large files through Samba.
To workaround this, the lfs option should be used in the mount options :