Condivisione dischi Lubuntu e Windows 7

Networking, configurazione della connessione, periferiche e condivisioni di rete.
Scrivi risposta
Avatar utente
Hari Seldon
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1338
Iscrizione: domenica 27 gennaio 2008, 10:43
Desktop: gnome-classic (Mate)
Distribuzione: Ubuntu 18.04LTS - Lubuntu 22.04LTS
Località: South Sardinia/Lombardy
Contatti:

Condivisione dischi Lubuntu e Windows 7

Messaggio da Hari Seldon »

Buongiorno a tutti, chiedo assistenza perchè ho necessità di condividere in rete i dischi di un PC Windows 7 con quelli di un PC su cui ho un Lubuntu 18.04.
Ho attivato samba, riesco a pingare dai due pc l'uno verso l'altro ma non riesco ad accedere ai dischi nè da una parte ne dall'altra.
Qualcuno può aiutarmi?

Gli indirizzi dei due pc sulla rete sono 192.168.1.6 per il pc Windows e 192.168.1.10 per Lubuntu

già che ci sono:

Codice: Seleziona tutto

moses@moses:~$ ifconfig -a
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.10  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 2001:b07:5d2e:69cf:9e0c:2ce4:7039:8c94  prefixlen 64  scopeid 0x0<global>
        inet6 2001:b07:5d2e:69cf:59e6:b31e:e105:aa96  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::d2dd:ad16:14b8:50f5  prefixlen 64  scopeid 0x20<link>
        ether 00:19:66:79:3e:28  txqueuelen 1000  (Ethernet)
        RX packets 183195  bytes 205707447 (205.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 109983  bytes 15885093 (15.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Loopback locale)
        RX packets 13207  bytes 1328647 (1.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 13207  bytes 1328647 (1.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Codice: Seleziona tutto

sudo gedit /etc/samba/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 ";", the proposed setting
#    differs from the default Samba behaviour
#  - When commented with "#", the proposed setting is the default
#    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
# "testparm" to check that you have not made any basic syntactic 
# errors. 

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
	server string = %h server (Samba, Ubuntu)

# 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/netmask;
# interface names are normally preferred
;   interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself.  However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
;   bind interfaces only = yes



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m

# 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 'yes'.
#   syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
   syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
   panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller". 
#
# Most people will want "standalone sever" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
   server role = standalone server

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.  
   passdb backend = tdbsam

   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 <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
   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 'server role = primary
# classic domain controller', 'server role = backup domain controller'
# or 'domain logons' is set 
#

# It specifies the location of the user's
# 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's default)
#   logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# 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 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
;   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 = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

# This allows machine accounts to be created on the domain controller via the 
# SAMR RPC pipe.  
# The following assumes a "machines" group exists on the system
; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.  
; add group script = /usr/sbin/addgroup --force-badname %g

############ Misc ############

# 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
;   include = /home/samba/etc/smb.conf.%m

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
;   idmap uid = 10000-20000
;   idmap gid = 10000-20000
;   template shell = /bin/bash

# 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.
;   usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
   usershare allow guests = yes

#======================= Share Definitions =======================

# 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]
;   comment = Home Directories
;   browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
;   read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
;   create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
;   directory mask = 0700

# 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 "username"
# 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.)
;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   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
;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# 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

#modificato da PC da qui

[global]
	netbios name = moses
	workgroup = GENESIS

	server string = %h Samba Server - Version %v

	domain logons = no
	domain master = no
	local master = yes
	preferred master = no
	os level = 3

	dns proxy = yes
	wins support = no

	server role = auto
	security = user
	encrypt passwords = yes
	guest account = nobody
	directory mask = 0755
	create mask = 0644

	; hosts allow = 127.0.0.1 192.168.0.0/24 10.0.0.0/24

	syslog = 0
	log file = /var/log/samba/log.%m
	max log size = 1000
	
# Le definizioni degli share creati direttamente tramite DE (Unity, KDE, ...) vengono memorizzate nella directory /var/lib/samba/usershares

[homes]
	comment = Home Directory
	available = yes
	browseable = no
	writeable = yes
	guest ok = no
	guest only = no
	valid users = %U

[temp]
	comment = Temp
	path = /temp
	available = yes
	browseable = yes
	writeable = yes
	; If this parameter is yes for a service, then no password is required to connect to the service
	guest ok = no
	; If this parameter is yes for a service, then only guest connections to the service are permitted
	; This parameter will have no effect if guest ok is not set for the service
	guest only = no
Grazie mille in anticipo
Ultima modifica di Hari Seldon il venerdì 13 gennaio 2023, 21:10, modificato 1 volta in totale.
Avatar utente
thece
Tenace Tecnocrate
Tenace Tecnocrate
Messaggi: 12949
Iscrizione: lunedì 23 aprile 2007, 14:16
Distribuzione: Debian 12 (Bookworm) - KDE

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da thece »

:ciao:

[HOWTO] Samba - Installazione & Configurazione

Leggi attentamente e fai come indicato. Negli appunti viene spiegato anche come fare le prime verifiche di funzionamento.


Frase di rito: come avrai sicuramente già visto in giro per il Forum, per rendere più comprensibile la discussione, dovresti formattare correttamente sia i comandi impartiti sia i relativi output racchiudendoli tra i tag [ code ] ... [ /code ] (scritti senza spazi) in modo da ottenere un qualcosa del genere

Codice: Seleziona tutto

COMANDO
...
OUTPUT
...
Puoi applicare i tag automaticamente selezionando il testo che vuoi racchiudere tra di essi e poi premendo il bottone </> (Codice) nella pulsantiera posta sopra il riquadro di scrittura.
Sei invitato a modificare il tuo precedente post.

Immagine
Avatar utente
Hari Seldon
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1338
Iscrizione: domenica 27 gennaio 2008, 10:43
Desktop: gnome-classic (Mate)
Distribuzione: Ubuntu 18.04LTS - Lubuntu 22.04LTS
Località: South Sardinia/Lombardy
Contatti:

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da Hari Seldon »

thece ha scritto:
venerdì 13 gennaio 2023, 13:33
:ciao:

[HOWTO] Samba - Installazione & Configurazione

Leggi attentamente e fai come indicato. Negli appunti viene spiegato anche come fare le prime verifiche di funzionamento.
Prima di tutto grazie per l'assistenza. Sto seguendo la guida e ho un primo problema: quando cerco di fare ripartire samba mi da questo errore:

Codice: Seleziona tutto

moses@moses:~$ sudo /etc/init.d/samba restart
[sudo] password di moses: 
sudo: /etc/init.d/samba: comando non trovato

Posso riavviare il pc, in alternativa. Ma magari semplicemente nella 18.04 hanno aggiornato il comando rispetto alla 16.04 a cui si riferisce la guida

Frase di rito: come avrai sicuramente già visto in giro per il Forum, per rendere più comprensibile la discussione, dovresti formattare correttamente sia i comandi impartiti sia i relativi output racchiudendoli tra i tag [ code ] ... [ /code ] (scritti senza spazi) in modo da ottenere un qualcosa del genere
chiedo scusa, era un po' che non postavo nel forum e ho sbagliato tag. Ho corretto
Avatar utente
Hari Seldon
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1338
Iscrizione: domenica 27 gennaio 2008, 10:43
Desktop: gnome-classic (Mate)
Distribuzione: Ubuntu 18.04LTS - Lubuntu 22.04LTS
Località: South Sardinia/Lombardy
Contatti:

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da Hari Seldon »

Hari Seldon ha scritto:
sabato 14 gennaio 2023, 9:23
quando cerco di fare ripartire samba mi da questo errore:

Codice: Seleziona tutto

moses@moses:~$ sudo /etc/init.d/samba restart
[sudo] password di moses: 
sudo: /etc/init.d/samba: comando non trovato
Posso riavviare il pc, in alternativa. Ma magari semplicemente nella 18.04 hanno aggiornato il comando rispetto alla 16.04 a cui si riferisce la guida
mi rispondo da solo, il comando equivalente è

Codice: Seleziona tutto

sudo service smbd restart
Nel frattempo ho provato a pingare da una parte e dall'altra e il ping funziona. Non riesco ancora ad accedere alle directory, neanche alla temp di Ubuntu da WIndows.

Codice: Seleziona tutto

moses@moses:~$ sudo netstat -tulnp | egrep 'nmbd|smbd'
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      3076/smbd           
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      3076/smbd           
tcp6       0      0 :::139                  :::*                    LISTEN      3076/smbd           
tcp6       0      0 :::445                  :::*                    LISTEN      3076/smbd           
udp        0      0 192.168.1.255:137       0.0.0.0:*                           568/nmbd            
udp        0      0 192.168.1.10:137        0.0.0.0:*                           568/nmbd            
udp        0      0 0.0.0.0:137             0.0.0.0:*                           568/nmbd            
udp        0      0 192.168.1.255:138       0.0.0.0:*                           568/nmbd            
udp        0      0 192.168.1.10:138        0.0.0.0:*                           568/nmbd            
udp        0      0 0.0.0.0:138             0.0.0.0:*                           568/nmbd       
questa lista raccoglie tutti gli ip presenti nella mia rete?
Avatar utente
Hari Seldon
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1338
Iscrizione: domenica 27 gennaio 2008, 10:43
Desktop: gnome-classic (Mate)
Distribuzione: Ubuntu 18.04LTS - Lubuntu 22.04LTS
Località: South Sardinia/Lombardy
Contatti:

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da Hari Seldon »

Se faccio il ping dal pc Ubuntu verso quello Windows ho il seguente risultato:

Codice: Seleziona tutto

moses@moses:~$ ping -c 4 192.168.1.6
PING 192.168.1.6 (192.168.1.6) 56(84) bytes of data.
64 bytes from 192.168.1.6: icmp_seq=2 ttl=128 time=2.39 ms
64 bytes from 192.168.1.6: icmp_seq=3 ttl=128 time=2.21 ms
64 bytes from 192.168.1.6: icmp_seq=4 ttl=128 time=2.29 ms

--- 192.168.1.6 ping statistics ---
4 packets transmitted, 3 received, 25% packet loss, time 3012ms
rtt min/avg/max/mdev = 2.210/2.300/2.392/0.084 ms
Il ping inverso (dal pc WIndows all'IP del pc Ubuntu) da come risultato il 100% di pacchetti ricevuti
Avatar utente
thece
Tenace Tecnocrate
Tenace Tecnocrate
Messaggi: 12949
Iscrizione: lunedì 23 aprile 2007, 14:16
Distribuzione: Debian 12 (Bookworm) - KDE

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da thece »

Come scritto in testa agli appunti, quelli erano validi in toto per Ubuntu 16.04. Nelle versioni successive molte cose sono cambiate, tra queste il modo in cui riavviare i servizi di Samba (smbd e nmbd).
Oltre al modo che hai trovato tu, è disponibile anche il seguente

Codice: Seleziona tutto

sudo systemctl stop smbd.service 
sudo systemctl stop nmbd.service 
sudo systemctl start nmbd.service 
sudo systemctl start smbd.service
I servizi smbd e nmbd vanno riavviati entrambi

Puoi controllarne lo stato con i comandi

Codice: Seleziona tutto

systemctl --no-pager status smbd.service 
systemctl --no-pager status nmbd.service 
Se il file /etc/samba/smb.conf che hai postato è quello che hai configurato attualmente: è sbagliato! Non devi aggiungere il contenuto che ho postato io al tuo, lo devi sostituire, come indicato negli appunti.

Non ti incaponire sul ping. Un ping funzionante indica solamente che i due PC "si vedono in rete", o meglio sono raggiungibili uno con l'altro. Ma il ping potrebbe non essere funzionante e la connessione Samba (in questo caso) potrebbe funzionare benissimo. Tutto dipende da se e come sono configurati eventuali firewall.
Diciamo che un ping funzionate è un segnale che indica che potenzialmente non ci sono problemi di connessione di rete fra i due PC.

Il primo test che devi riuscire a far funzionare è la connessione in locale tramite il comando smbclient.

Senza autenticazione

Codice: Seleziona tutto

smbclient -N -L localhost
Con autenticazione

Codice: Seleziona tutto

smbclient -U USER -L localhost
sostituisci USER con l'utente che hai configurato per Samba
Avatar utente
Hari Seldon
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1338
Iscrizione: domenica 27 gennaio 2008, 10:43
Desktop: gnome-classic (Mate)
Distribuzione: Ubuntu 18.04LTS - Lubuntu 22.04LTS
Località: South Sardinia/Lombardy
Contatti:

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da Hari Seldon »

Codice: Seleziona tutto

moses@moses:~$ smbclient -N -L localhost
WARNING: The "syslog" option is deprecated
Anonymous login successful

	Sharename       Type      Comment
	---------       ----      -------
	temp            Disk      Temp
	IPC$            IPC       IPC Service (moses Samba Server - Version 4.7.6-Ubuntu)
Reconnecting with SMB1 for workgroup listing.
protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE
Failed to connect with SMB1 -- no workgroup available
e

Codice: Seleziona tutto

moses@moses:~$ smbclient -U moses -L localhost
WARNING: The "syslog" option is deprecated
Enter WORKGROUP\moses's password: 

	Sharename       Type      Comment
	---------       ----      -------
	temp            Disk      Temp
	IPC$            IPC       IPC Service (moses Samba Server - Version 4.7.6-Ubuntu)
	moses           Disk      moses - Home Directory
Reconnecting with SMB1 for workgroup listing.
protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE
Failed to connect with SMB1 -- no workgroup available
ovviamente il mio user si chiama moses e il mio workgroup WORKGROUP

thece ha scritto:
sabato 14 gennaio 2023, 17:33
Come scritto in testa agli appunti, quelli erano validi in toto per Ubuntu 16.04. Nelle versioni successive molte cose sono cambiate, tra queste il modo in cui riavviare i servizi di Samba (smbd e nmbd).
Oltre al modo che hai trovato tu, è disponibile anche il seguente

Codice: Seleziona tutto

sudo systemctl stop smbd.service 
sudo systemctl stop nmbd.service 
sudo systemctl start nmbd.service 
sudo systemctl start smbd.service
I servizi smbd e nmbd vanno riavviati entrambi
Prendo nota, grazie

Codice: Seleziona tutto

moses@moses:~$ systemctl --no-pager status smbd.service 
● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2023-01-15 09:27:56 CET; 43min ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 702 (smbd)
   Status: "smbd: ready to serve connections..."
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/smbd.service
           ├─702 /usr/sbin/smbd --foreground --no-process-group
           ├─710 /usr/sbin/smbd --foreground --no-process-group
           ├─711 /usr/sbin/smbd --foreground --no-process-group
           └─712 /usr/sbin/smbd --foreground --no-process-group

gen 15 09:27:55 moses systemd[1]: Starting Samba SMB Daemon...
gen 15 09:27:56 moses systemd[1]: Started Samba SMB Daemon.

Codice: Seleziona tutto

moses@moses:~$ systemctl --no-pager status nmbd.service 
● nmbd.service - Samba NMB Daemon
   Loaded: loaded (/lib/systemd/system/nmbd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2023-01-15 09:27:55 CET; 44min ago
     Docs: man:nmbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 563 (nmbd)
   Status: "nmbd: ready to serve connections..."
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/nmbd.service
           ├─563 /usr/sbin/nmbd --foreground --no-process-group
           └─697 /usr/sbin/nmbd --foreground --no-process-group

gen 15 09:27:41 moses systemd[1]: Starting Samba NMB Daemon...
gen 15 09:27:55 moses systemd[1]: Started Samba NMB Daemon.
Ultima modifica di Hari Seldon il lunedì 13 febbraio 2023, 20:14, modificato 1 volta in totale.
Avatar utente
thece
Tenace Tecnocrate
Tenace Tecnocrate
Messaggi: 12949
Iscrizione: lunedì 23 aprile 2007, 14:16
Distribuzione: Debian 12 (Bookworm) - KDE

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da thece »

Al momento non vedo problemi.
Il passo/test successivo potrebbe essere quello di provare a collegarsi ad uno share, sempre localmente, sempre tramite smbclient

Codice: Seleziona tutto

smbclient -U moses //localhost/moses
Se anche questo non mostra errori significa che il server Samba sta funzionando correttamente, quindi non ti rimane che provare a collegarti da Windows 7.
Avatar utente
Hari Seldon
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1338
Iscrizione: domenica 27 gennaio 2008, 10:43
Desktop: gnome-classic (Mate)
Distribuzione: Ubuntu 18.04LTS - Lubuntu 22.04LTS
Località: South Sardinia/Lombardy
Contatti:

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da Hari Seldon »

I problemi, nonostante abbia provato a seguire la guida di thece, non si risolvono. Per essere sicuro che non ci siano problemi di installazione ho digitato:

Codice: Seleziona tutto

moses@moses:~$ sudo dpkg-reconfigure samba
[sudo] password di moses: 
Samba is not being run as an AD Domain Controller.
Please ignore the following error about deb-systemd-helper not finding samba-ad-dc.service.
Job for smbd.service failed because the control process exited with error code.
See "systemctl status smbd.service" and "journalctl -xe" for details.
invoke-rc.d: initscript smbd, action "restart" failed.
● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2023-01-15 17:48:10 CET; 45ms ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 8448 ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS (code=exited, status=255)
 Main PID: 8448 (code=exited, status=255)

gen 15 17:48:09 moses systemd[1]: Starting Samba SMB Daemon...
gen 15 17:48:10 moses systemd[1]: smbd.service: Main process exited, code=exited, status=255/n/a
gen 15 17:48:10 moses systemd[1]: smbd.service: Failed with result 'exit-code'.
gen 15 17:48:10 moses systemd[1]:Failed to start Samba SMB Daemon.
il messaggio

Codice: Seleziona tutto

Failed to start Samba SMB Daemon
lascia pensare ci siano ancora problemi irrisolti
Avatar utente
trekfan1
Moderatore Globale
Moderatore Globale
Messaggi: 23405
Iscrizione: domenica 21 maggio 2006, 10:51
Desktop: Gnome
Distribuzione: Ubuntu 23.10 e 24.04 (dev)
Sesso: Maschile
Località: Formigine (MO) | Accecante Asceta

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da trekfan1 »

Su windows hai disattivato la "Condivisione protetta da password"?
Avatar utente
Hari Seldon
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1338
Iscrizione: domenica 27 gennaio 2008, 10:43
Desktop: gnome-classic (Mate)
Distribuzione: Ubuntu 18.04LTS - Lubuntu 22.04LTS
Località: South Sardinia/Lombardy
Contatti:

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da Hari Seldon »

thece ha scritto:
domenica 15 gennaio 2023, 14:22
Al momento non vedo problemi.
Il passo/test successivo potrebbe essere quello di provare a collegarsi ad uno share, sempre localmente, sempre tramite smbclient

Codice: Seleziona tutto

smbclient -U moses //localhost/moses
Se anche questo non mostra errori significa che il server Samba sta funzionando correttamente, quindi non ti rimane che provare a collegarti da Windows 7.

Codice: Seleziona tutto

moses@moses:~$ smbclient -U moses //localhost/moses
WARNING: The "syslog" option is deprecated
Connection to localhost failed (Error NT_STATUS_CONNECTION_REFUSED)
Avatar utente
Hari Seldon
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1338
Iscrizione: domenica 27 gennaio 2008, 10:43
Desktop: gnome-classic (Mate)
Distribuzione: Ubuntu 18.04LTS - Lubuntu 22.04LTS
Località: South Sardinia/Lombardy
Contatti:

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da Hari Seldon »

trekfan1 ha scritto:
domenica 15 gennaio 2023, 20:36
Su windows hai disattivato la "Condivisione protetta da password"?
No, provo a farlo, grazie.

Peraltro non vorrei esporre i contenuti dei miei dischi, per cui comunque preferirei un accesso in rete con user e password
Avatar utente
thece
Tenace Tecnocrate
Tenace Tecnocrate
Messaggi: 12949
Iscrizione: lunedì 23 aprile 2007, 14:16
Distribuzione: Debian 12 (Bookworm) - KDE

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da thece »

(Adesso) Il problema è sul server Samba, ma questo output
Hari Seldon ha scritto:
lunedì 16 gennaio 2023, 12:34

Codice: Seleziona tutto

moses@moses:~$ smbclient -U moses //localhost/moses
WARNING: The "syslog" option is deprecated
Connection to localhost failed (Error NT_STATUS_CONNECTION_REFUSED)
non è coerente con questo tuo precedente output
Hari Seldon ha scritto:
domenica 15 gennaio 2023, 10:08

Codice: Seleziona tutto

moses@moses:~$ smbclient -U moses -L localhost
WARNING: The "syslog" option is deprecated
Enter GENESIS\moses's password: 

	Sharename       Type      Comment
	---------       ----      -------
	temp            Disk      Temp
	IPC$            IPC       IPC Service (moses Samba Server - Version 4.7.6-Ubuntu)
	moses           Disk      moses - Home Directory
Reconnecting with SMB1 for workgroup listing.
protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE
Failed to connect with SMB1 -- no workgroup available
quindi nel frattempo "hai rotto" qualcosa ... che cosa? Mia ipotesi? Hai pasticciato con il file /etc/samba/smb.conf

NT_STATUS_CONNECTION_REFUSED indica che almeno uno dei due servizi di Samba (smbd, nmbd) non sta funzionando.

Codice: Seleziona tutto

systemctl --no-pager status smbd.service 
systemctl --no-pager status nmbd.service
Avatar utente
Hari Seldon
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1338
Iscrizione: domenica 27 gennaio 2008, 10:43
Desktop: gnome-classic (Mate)
Distribuzione: Ubuntu 18.04LTS - Lubuntu 22.04LTS
Località: South Sardinia/Lombardy
Contatti:

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da Hari Seldon »

Codice: Seleziona tutto

moses@moses:~$ systemctl --no-pager status smbd.service 
● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2023-01-16 11:08:47 CET; 9h ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 689 ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS (code=exited, status=255)
 Main PID: 689 (code=exited, status=255)

gen 16 11:08:46 moses systemd[1]: Starting Samba SMB Daemon...
gen 16 11:08:47 moses systemd[1]: smbd.service: Main process exited, code=e…/n/a
gen 16 11:08:47 moses systemd[1]: smbd.service: Failed with result 'exit-code'.
gen 16 11:08:47 moses systemd[1]: Failed to start Samba SMB Daemon.
Hint: Some lines were ellipsized, use -l to show in full.

Codice: Seleziona tutto

moses@moses:~$ systemctl --no-pager status nmbd.service
● nmbd.service - Samba NMB Daemon
   Loaded: loaded (/lib/systemd/system/nmbd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2023-01-16 11:08:46 CET; 9h ago
     Docs: man:nmbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 598 (nmbd)
   Status: "nmbd: ready to serve connections..."
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/nmbd.service
           ├─598 /usr/sbin/nmbd --foreground --no-process-group
           └─685 /usr/sbin/nmbd --foreground --no-process-group

gen 16 11:08:40 moses systemd[1]: Starting Samba NMB Daemon...
gen 16 11:08:46 moses systemd[1]: Started Samba NMB Daemon.
Avatar utente
trekfan1
Moderatore Globale
Moderatore Globale
Messaggi: 23405
Iscrizione: domenica 21 maggio 2006, 10:51
Desktop: Gnome
Distribuzione: Ubuntu 23.10 e 24.04 (dev)
Sesso: Maschile
Località: Formigine (MO) | Accecante Asceta

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da trekfan1 »

La condivisione protetta da password ha senso in un ambito aziendale, in ambito privato non ha senso, specie se i pc li usi solo tu, cmq ok...
Avatar utente
thece
Tenace Tecnocrate
Tenace Tecnocrate
Messaggi: 12949
Iscrizione: lunedì 23 aprile 2007, 14:16
Distribuzione: Debian 12 (Bookworm) - KDE

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da thece »

Non parte il servizio smbd, punto su un errore di configurazione nel file smb.conf

Dai un'occhiata anche al log di systemd e di Samba
Avatar utente
Hari Seldon
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1338
Iscrizione: domenica 27 gennaio 2008, 10:43
Desktop: gnome-classic (Mate)
Distribuzione: Ubuntu 18.04LTS - Lubuntu 22.04LTS
Località: South Sardinia/Lombardy
Contatti:

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da Hari Seldon »

trekfan1 ha scritto:
lunedì 16 gennaio 2023, 21:58
La condivisione protetta da password ha senso in un ambito aziendale, in ambito privato non ha senso, specie se i pc li usi solo tu, cmq ok...
L'importante è che non sia possibile che qualcuno possa accedere al mio pc bucando la wireless. Comunque ho disabilitato l'opzione
Avatar utente
Hari Seldon
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1338
Iscrizione: domenica 27 gennaio 2008, 10:43
Desktop: gnome-classic (Mate)
Distribuzione: Ubuntu 18.04LTS - Lubuntu 22.04LTS
Località: South Sardinia/Lombardy
Contatti:

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da Hari Seldon »

thece ha scritto:
martedì 17 gennaio 2023, 9:22
Non parte il servizio smbd, punto su un errore di configurazione nel file smb.conf
Ecco il smb.conf

Codice: Seleziona tutto

[global]
	allow hosts = 192.168.1.0/24    
	netbios name = moses
	workgroup = WORKGROUP
	security = user	
	server string = %h Samba Server - Version %v

	domain logons = no
	domain master = no
	local master = yes
	preferred master = no
	os level = 3

	server role = auto
	
	encrypt passwords = yes
	map to guest = Bad User
	guest account = paolo
	directory mask = 0755
	create mask = 0644
	
	# Protocolli di connessione che dovranno essere supportati dal client
	; client min protocol = CORE
	; client max protocol = default
	# Protocolli di connessione supportati dal server
	; server min protocol = NT1
	server min protocol = SMB2
	server max protocol = SMB3

	# Permette la connessione dei client che supportano il protocollo di connessione LANMAN (Windows NT / 2000 / 95 / 98)
	; lanman a3444444444444444444444444444444444uth = yes
	# Permette la connessione dei client che supportano il protocollo di connessione NTLM (Windows XP)
	; ntlm auth = yes

	dns proxy = yes
	wins support = yes
	name resolve order = lmhosts host wins bcast

	syslog = 0
	log file = /var/log/samba/log.%m
	max log size = 1000

########## Usershare ##########

	# Le definizioni degli share creati tramite DE (Unity, Gnome, KDE, XFCE, ... ) vengono memorizzate nella directory /var/lib/samba/usershares
	# Per condividere una qualsiasi directory del filesystem
	; usershare owner only = false
	# Per abilitare l'accesso agli share senza autenticazione
	; usershare allow guests = yes

[homes]
	comment = %U - Home Directory
	available = yes
	browseable = no
	writeable = yes
	guest ok = no
	guest only = no
	valid users = %U

[temp]
	comment = Temp
	path = /temp
	available = yes
	browseable = yes
	writeable = yes
	# If this parameter is yes for a service, then no password is required to connect to the service
	guest ok = no
	# If this parameter is yes for a service, then only guest connections to the service are permitted
	# This parameter will have no effect if guest ok is not set for the service
	guest only = no
Dai un'occhiata anche al log di systemd e di Samba
Per questo però non so come fare
Ultima modifica di Hari Seldon il lunedì 13 febbraio 2023, 20:12, modificato 1 volta in totale.
Avatar utente
thece
Tenace Tecnocrate
Tenace Tecnocrate
Messaggi: 12949
Iscrizione: lunedì 23 aprile 2007, 14:16
Distribuzione: Debian 12 (Bookworm) - KDE

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da thece »

Questa chiave

Codice: Seleziona tutto

allow hosts = 192.168.1.0/24
è scritta sbagliata. Correggi in

Codice: Seleziona tutto

hosts allow = 127.0.0.1 192.168.1.0/24
Questa chiave

Codice: Seleziona tutto

guest account = paolo
è scritta sbagliata. Correggi in

Codice: Seleziona tutto

guest account = nobody
Correggi il file di configurazione. Riavvia i servizi di Samba e ripeti i controlli.
Avatar utente
trekfan1
Moderatore Globale
Moderatore Globale
Messaggi: 23405
Iscrizione: domenica 21 maggio 2006, 10:51
Desktop: Gnome
Distribuzione: Ubuntu 23.10 e 24.04 (dev)
Sesso: Maschile
Località: Formigine (MO) | Accecante Asceta

Re: Condivisione dischi Lubuntu e Windows 7

Messaggio da trekfan1 »

Hari Seldon ha scritto:
martedì 17 gennaio 2023, 14:24
trekfan1 ha scritto:
lunedì 16 gennaio 2023, 21:58
La condivisione protetta da password ha senso in un ambito aziendale, in ambito privato non ha senso, specie se i pc li usi solo tu, cmq ok...
L'importante è che non sia possibile che qualcuno possa accedere al mio pc bucando la wireless. Comunque ho disabilitato l'opzione
Se hai paura che ti "buchino" la password del wifi scegline una robusta (stiamo cmq andando :ot: e me ne rendo conto) cmq non fare post consecutivi se non ci sono risposte ma clicca sulla matita e aggiungi il nuovo testo eventualmente preceduto da EDIT, grazie :)
Scrivi risposta

Ritorna a “Connessione e configurazione delle reti”

Chi c’è in linea

Visualizzano questa sezione: 0 utenti iscritti e 14 ospiti