PDA

View Full Version : Condivisione directory in rete


CielitoLindux
26-04-2016, 19:04
Buonasera a tutti
Sto cercando di condividere una cartella del mio server in rete ma senza successo.
Alcune info:
Lato Server: Ubuntu 14.04 LTS
Creata la direcotry /mnt/dati con i seguenti permessi cielito@Server:~$ ls -ll /mnt/dati/
totale 20
drwxrwxrwx 4 cielito cielito 4096 apr 23 18:34 amule
drwx-w--w- 2 cielito cielito 16384 apr 23 17:52 lost+found
cielito@Server:~$

Modificato smb.conf in questo modo:
[dati]
comment = directory condivisione
path = /mnt/dati
public = yes
available = yes
writeable = yes
; browseable = yes
guest ok = yes
guest only = yes

Riavviati smbd e nmbd.

Lato client ArchLinux:
Ping: [root@arch ~]# ping 192.168.1.5
PING 192.168.1.5 (192.168.1.5) 56(84) bytes of data.
64 bytes from 192.168.1.5: icmp_seq=1 ttl=64 time=15.6 ms
64 bytes from 192.168.1.5: icmp_seq=2 ttl=64 time=1.43 ms
64 bytes from 192.168.1.5: icmp_seq=3 ttl=64 time=1.74 ms
64 bytes from 192.168.1.5: icmp_seq=4 ttl=64 time=11.8 ms
^C
--- 192.168.1.5 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 1.436/7.678/15.671/6.238 ms
[root@arch ~]#

Aggiunta a fstab la riga //192.168.1.5/mnt/dati /mnt/amule ext4 rw,defaults 0 0

Ma: [root@arch ~]# mount -a
mount: special device //192.168.1.5/mnt/dati does not exist
[root@arch ~]#
Dove sbaglio? O cosa manca?

sacarde
26-04-2016, 20:11
che vedi da:

smbclient -L <ip> (visualizza condivisioni)

testparm

CielitoLindux
26-04-2016, 20:22
cielito@Server:~$ smbclient -L 192.168.1.5
WARNING: The "syslog" option is deprecated
Enter cielito's password:
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.3.8-Ubuntu]

Sharename Type Comment
--------- ---- -------
print$ Disk Printer Drivers
amule Disk directory condivisione amule
IPC$ IPC IPC Service (Server server (Samba, Ubuntu))
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.3.8-Ubuntu]

Server Comment
--------- -------
SERVER Server server (Samba, Ubuntu)

Workgroup Master
--------- -------
WORKGROUP
cielito@Server:~$

sacarde
26-04-2016, 20:35
la dir condivisa sembrerebbe "amule"



che vedi da: testparm

CielitoLindux
27-04-2016, 21:21
La dir condivisa dovrebbe essere /mnt/dati al cui interno c'è (per ora) solo la dir amule (oltre a lost+found). Cmq penso che una volta capito il funzionamento non dovrebbe essere difficile modificare le cose.

cielito@Server:~$ testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "syslog" option is deprecated
Processing section "[printers]"
Processing section "[print$]"
Processing section "[amule]"
Loaded services file OK.
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
server string = %h server (Samba, Ubuntu)
server role = standalone server
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
usershare allow guests = Yes
panic action = /usr/share/samba/panic-action %d
idmap config * : backend = tdb


[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0700
printable = Yes
browseable = No


[print$]
comment = Printer Drivers
path = /var/lib/samba/printers


[amule]
comment = directory condivisione amule
path = /mnt/dati
read only = No
guest ok = Yes
cielito@Server:~$

gianmpu
28-04-2016, 05:05
In realtà il nome Amule che viene mostrato è quello della sezione nel file smb.conf ma la directory condivisa è effettivamente /mnt/dati.
L'errore, invece, sembra si riferisca al fatto che stai cercando di montare qualcosa ma il sistema non riesce ad associarlo ad uno dei device in /dev

Inviato dal mio GT-N5100 utilizzando Tapatalk

CielitoLindux
28-04-2016, 08:30
Si è vero. Per il client quel device sembra non esistere. :mc:

CielitoLindux
28-04-2016, 18:59
Niente da fare. Non capisco cosa non gli vada bene. In tutte le guide che trovo su samba sembra tutto così semplice.

sacarde
28-04-2016, 19:14
hai provato? :


smbclient //192.168.1.5/amule





p.s.
io per linux su linux preferisco NFS

CielitoLindux
29-04-2016, 08:22
hai provato? :
smbclient //192.168.1.5/amule
Si e non funziona.

p.s.
io per linux su linux preferisco NFS
Proverò anche quello.

menk
29-04-2016, 12:38
Ma non manca il protocollo di condivisione nella riga aggiunta in fs tab????

CielitoLindux
29-04-2016, 14:15
Ma non manca il protocollo di condivisione nella riga aggiunta in fs tab????
Cioè?

menk
29-04-2016, 14:23
//192.168.1.5/mnt/dati /mnt/amule ext4 rw,defaults 0 0

Non devi specifcare un file system di tipo ext4 ma bensì il file system che monti in remoto, quindi cifs

ad esempio :

//192.168.1.5/mnt/dati /mnt/amule cifs rw,defaults 0 0


https://wiki.ubuntu.com/MountWindowsSharesPermanently

CielitoLindux
29-04-2016, 14:27
Umh... il fs che devo montare è in ext4. Devo mettere cifs ugualmente? Cmq ho provato anche cifs ma non sono riuscito a montarlo ugualmente.

menk
29-04-2016, 14:34
allora, se devi montare tramite un file system remoto (condivisione samba/cifs) come fai a dire che il file system che devi montare è un ext4?
ext 4 sarà il file system con cui hai partizionato il tuo disco locale del client e/o anche il disco locale del server, ma questo non centra nulla con una mount di un file system di rete, in cui non viene specificato il file system remoto.
la specifica del CIFS nella mount è necessaria, quella di ext4 (parlo del tyuo caso ovviamente) non va assolutamente specificata.

CielitoLindux
29-04-2016, 14:38
Si. Sia il mio client che il mio server sono in ext4. Pensavo che come per i dischi locali andasse specificato il fs da montare. Quindi devo sostituire cifs a ext4 giusto? Non avendo dato nessuna pwd e la possibilità di accedere a chiunque non dovrei nemmeno specificare utenti o pwd, giusto?

menk
29-04-2016, 14:42
se non hai dato password e hai un accesso guest non devi specificare nulla (molto pericoloso imho).
il file system che tu devi montare non è un fs locale (aka ext4) ma un fs di rete (aka cifs).
quindi nella specifica del comando mount nella locazione del file system va specificato CIFS ( nel caso tu volessi fare una mount nfs va specificato NFS ecc).
dai una letta al link che ti ho indicato e ti togli i dubbi.
;)

CielitoLindux
29-04-2016, 14:51
Si infatti stavo leggendo.
Per ora vado liscio senza password e vediamo se intanto me lo monta. Poi ad aggiungere difficoltà ci pensiamo dopo :p
Grazie per le spiegazioni. Stasera provo e ti faccio sapere com'è andata.

CielitoLindux
29-04-2016, 18:25
Niente da fare.
Linea in fstab:
//192.168.1.5/mnt/dati /mnt/amule cifs guest,uid=1000,iocharset=utf8 0 0
Risultato di mount -a
[root@arch ~]# mount -a
Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[root@arch ~]# :muro:

menk
29-04-2016, 19:47
Niente da fare.
Linea in fstab:
//192.168.1.5/mnt/dati /mnt/amule cifs guest,uid=1000,iocharset=utf8 0 0
Risultato di mount -a
[root@arch ~]# mount -a
Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[root@arch ~]# :muro:
se provi la mount fa cli che ottieni??
mount -t cifs //192.168.1.5/mnt/dati /mnt/amule -o rw,file_mode=0640,dir_mode=0755

menk
29-04-2016, 19:50
hai un pc windows da cui provare se riesci ad accedere??

sacarde
29-04-2016, 19:56
nei log del server vedi errori?

CielitoLindux
29-04-2016, 20:29
se provi la mount fa cli che ottieni??
mount -t cifs //192.168.1.5/mnt/dati /mnt/amule -o rw,file_mode=0640,dir_mode=0755
[root@arch ~]# mount -t cifs //192.168.1.5/mnt/dati /mnt/amule -o rw,file_mode=0640,dir_mode=0755
Password for root@//192.168.1.5/mnt/dati:

Ma sul server non ho una password di root. Solo quella utente da usare con sudo. Cmq anche dando quella non accede.

CielitoLindux
29-04-2016, 20:32
nei log del server vedi errori?
Ho diversi log. Ne ho letti alcuni.
cielito@Server:~$ cat /var/log/samba/
cores/ log.192.168.1.5 log.nmbd
log. log.arch log.server
log.192.168.1.245 log.%m log.smbd
cielito@Server:~$ cat /var/log/samba/log.192.168.1.5
cielito@Server:~$ cat /var/log/samba/log.192.168.1.5
cielito@Server:~$ cat /var/log/samba/log.192.168.1.5
cielito@Server:~$ cat /var/log/samba/log.arch
[2016/04/29 20:05:23.266143, 0] ../source3/param/loadparm.c:3245(process_usershare_file)
process_usershare_file: stat of /var/lib/samba/usershares/mnt failed. Permission denied
[2016/04/29 20:05:23.272020, 0] ../source3/param/loadparm.c:3226(process_usershare_file)
process_usershare_file: share name mnt/dati /mnt/amule contains invalid characters (any of %<>*?|/\+=;:",)
cielito@Server:~$ cat /var/log/samba/log.smbd
[2016/04/23 16:12:09.049266, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 16:22:18.696318, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 16:33:00.051924, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 16:41:54.658282, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 16:58:48.941189, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 17:00:51.045249, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 17:08:44.135858, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 17:11:33.342053, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 18:07:06.574718, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 18:13:22.770490, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 18:21:22.938728, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 18:33:29.832860, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 22:48:35.803280, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 23:07:30.363941, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 23:08:58.905680, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/23 23:10:25.995077, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/26 15:34:10.954777, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/26 19:21:53.830423, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/26 19:38:41.745547, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/26 19:41:21.860074, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/26 19:54:39.439503, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/26 20:03:35.053059, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/26 20:07:11.822420, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/26 21:16:06.702506, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/26 21:27:30.375579, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/28 19:42:46.386738, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/28 20:02:37.139232, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/29 19:27:27.224495, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/29 19:38:05.984990, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/29 19:38:59.353712, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2016/04/29 19:39:37.335647, 0] ../lib/util/become_daemon.c:124(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connections
cielito@Server:~$

CielitoLindux
29-04-2016, 20:40
hai un pc windows da cui provare se riesci ad accedere??
Sullo stesso pc ho windows10 e incredibilmente vi accedo tranquillamente!
Da non credere. Cmq.
Il problema allora non è la configurazione del server ma il client giusto? Quindi il problema è su arch.

CielitoLindux
29-04-2016, 21:10
Risolto.
Il percorso giusto da mettere in fstab è //192.168.1.5/amule. In questo modo riesco ad accedervi. Nei prossimi giorni farò un po' di configurazioni. Casomai richiederò di nuovo il vostro aiuto. Grazie.
Ps: riesco ad accedervi anche da cell andorid. :sofico: