Ho preso alcune camere wifi come queste:
[2020/10/23 12:26:03.706346, 3] ../../source3/smbd/negprot.c:757(reply_negprot)reply_negprot: No protocol supported ![2020/10/23 12:26:03.706480, 4] ../../source3/smbd/sec_ctx.c:319(set_sec_ctx_internal)setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0[2020/10/23 12:26:03.706529, 5] ../../libcli/security/security_token.c:53(security_token_debug)Security token: (NULL)[2020/10/23 12:26:03.706576, 5] ../../source3/auth/token_util.c:873(debug_unix_user_token)UNIX token of user 0Primary group is 0 and contains 0 supplementary groups[2020/10/23 12:26:03.706648, 5] ../../source3/smbd/uid.c:503(smbd_change_to_root_user)change_to_root_user: now uid=(0,0) gid=(0,0)[2020/10/23 12:26:03.706697, 4] ../../source3/smbd/sec_ctx.c:319(set_sec_ctx_internal)setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0[2020/10/23 12:26:03.706736, 5] ../../libcli/security/security_token.c:53(security_token_debug)Security token: (NULL)[2020/10/23 12:26:03.706778, 5] ../../source3/auth/token_util.c:873(debug_unix_user_token)UNIX token of user 0Primary group is 0 and contains 0 supplementary groups[2020/10/23 12:26:03.706839, 5] ../../source3/smbd/uid.c:503(smbd_change_to_root_user)change_to_root_user: now uid=(0,0) gid=(0,0)[2020/10/23 12:26:03.706887, 4] ../../source3/smbd/sec_ctx.c:319(set_sec_ctx_internal)setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0[2020/10/23 12:26:03.706926, 5] ../../libcli/security/security_token.c:53(security_token_debug)Security token: (NULL)[2020/10/23 12:26:03.706968, 5] ../../source3/auth/token_util.c:873(debug_unix_user_token)UNIX token of user 0Primary group is 0 and contains 0 supplementary groups[2020/10/23 12:26:03.707038, 5] ../../source3/smbd/uid.c:503(smbd_change_to_root_user)change_to_root_user: now uid=(0,0) gid=(0,0)[2020/10/23 12:26:03.707105, 4] ../../source3/smbd/sec_ctx.c:319(set_sec_ctx_internal)setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0[2020/10/23 12:26:03.707152, 5] ../../libcli/security/security_token.c:53(security_token_debug)Security token: (NULL)[2020/10/23 12:26:03.707197, 5] ../../source3/auth/token_util.c:873(debug_unix_user_token)UNIX token of user 0Primary group is 0 and contains 0 supplementary groups[2020/10/23 12:26:03.707265, 5] ../../source3/smbd/uid.c:503(smbd_change_to_root_user)change_to_root_user: now uid=(0,0) gid=(0,0)[2020/10/23 12:26:03.707322, 4] ../../source3/smbd/sec_ctx.c:319(set_sec_ctx_internal)setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0[2020/10/23 12:26:03.707367, 5] ../../libcli/security/security_token.c:53(security_token_debug)Security token: (NULL)[2020/10/23 12:26:03.707412, 5] ../../source3/auth/token_util.c:873(debug_unix_user_token)UNIX token of user 0Primary group is 0 and contains 0 supplementary groups[2020/10/23 12:26:03.707479, 5] ../../source3/smbd/uid.c:503(smbd_change_to_root_user)change_to_root_user: now uid=(0,0) gid=(0,0)[2020/10/23 12:26:03.707877, 3] ../../source3/smbd/server_exit.c:243(exit_server_common)Server exit (no protocol supported
In sostanza non riesce a negoziare un protocollo con il client.
Sul web consigliano di settare il protocollo minimo alla versione 1 di Samba, inserendo nel file di configurazione /etc/samba/smb.conf la riga:
client min protocol = NT1
Però non funziona. Provo anche con il valore "CORE" al posto di NT1 (anche se in realtà sono la stessa cosa). Poi ravano nell'help di Samba e trovo anche altri valori relativi al protocollo minimo. In particolare questo:
server min protocol = NT1
Bingo!
Ora va. Devo solo creare un'utenza dedicata:
sudo useradd cam
sudo passwd cam
sudo smbpasswd -a cam
e poi aggiungere lo share al file smb.conf:
[Cam]
comment = Share per le CAMs
path = /Path/Cam
valid users = cam
public = no
writable = yes
create mask = 0644
directory mask = 0755
; if you set this, all files get written as this user
force user = cam
Infine ricarico la configurazione di Samba:
sudo smbcontrol all reload-config
Fatto.