Montare il NAS [RISOLTO]

Postate qui per tutte le discussioni legate a Linux in generale.

Moderatore: Staff

Regole del forum
1) Citare sempre la versione di Slackware usata, la versione del Kernel e magari anche la versione della libreria coinvolta. Questi dati aiutano le persone che possono rispondere.
2) Per evitare confusione prego inserire in questo forum solo topic che riguardano appunto Gnu/Linux in genere, se l'argomento è specifico alla Slackware usate uno dei forum Slackware o Slackware64.
3) Leggere attentamente le risposte ricevute
4) Scrivere i messaggi con il colore di default, evitare altri colori.
5) Scrivere in Italiano o in Inglese, se possibile grammaticalmente corretto, evitate stili di scrittura poco chiari, quindi nessuna abbreviazione tipo telegramma o scrittura stile SMS o CHAT.
6) Appena registrati è consigliato presentarsi nel forum dedicato.

La non osservanza delle regole porta a provvedimenti di vari tipo da parte dello staff, in particolare la non osservanza della regola 5 porta alla cancellazione del post e alla segnalazione dell'utente. In caso di recidività l'utente rischia il ban temporaneo.
Avatar utente
Ansa89
Iper Master
Iper Master
Messaggi: 2703
Iscritto il: mer 29 ago 2007, 17:57
Nome Cognome: Stefano Ansaloni
Slackware: 14.2 64bit
Kernel: 4.9.61
Desktop: XFCE 4.12
Località: Modena

Re: Montare il NAS

Messaggio da Ansa89 »

sunreal ha scritto:
Ansa89 ha scritto:La directory "Dati_recuperati" è una semplice directory del nas o è proprio uno share samba?
È una directory del nas.
Le difficioltà potrebbero essere dovute al fatto che la directory non è uno share samba?


Prova a montare tutto il nas (anche se non credo si possa fare)

Codice: Seleziona tutto

mount.cifs //192.168.1.170 /mnt/NEWnas -o user=nascasa,uid=slck14_01-14,sec=ntlmv2
(Eventualmente prova anche con "sec=ntlm" e senza parametro "sec").

sunreal
Master
Master
Messaggi: 1599
Iscritto il: dom 10 apr 2005, 0:00
Slackware: 14.1
Desktop: kde
Località: P.P.P.

Re: Montare il NAS

Messaggio da sunreal »

rik70 ha scritto:Per curiosità:
ma se gli passi anche il flag -N cosa succede?

Es:

Codice: Seleziona tutto

smbclient -N -L //192.168.1.170
Succede questo:

Codice: Seleziona tutto

bash-4.2$ smbclient -N -L //192.168.1.170
session setup failed: NT_STATUS_ACCOUNT_DISABLED
bash-4.2$
Ansa89 ha scritto: Prova a montare tutto il nas (anche se non credo si possa fare)
Codice: Seleziona tutto

Codice: Seleziona tutto

  mount.cifs //192.168.1.170 /mnt/NEWnas -o user=nascasa,uid=slck14_01-14,sec=ntlmv2
(Eventualmente prova anche con "sec=ntlm" e senza parametro "sec").
Solito errore:

Codice: Seleziona tutto

mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

rik70
Iper Master
Iper Master
Messaggi: 2492
Iscritto il: gio 10 mar 2011, 9:21
Slackware: 15.0
Kernel: 5.15.x-generic
Desktop: Sway
Distribuzione: Arch Linux

Re: Montare il NAS

Messaggio da rik70 »

sunreal ha scritto:

Codice: Seleziona tutto

bash-4.2$ smbclient -N -L //192.168.1.170
session setup failed: NT_STATUS_ACCOUNT_DISABLED
bash-4.2$
Strano, la lista delle directory condivise te la deve dare. Sei sicuro che il servizio sia attivo sul NAS? Dallo screenshot che hai incollato prima si vede la sezione riguardante NFS, ma quella Windows file service?


Immagine

sunreal
Master
Master
Messaggi: 1599
Iscritto il: dom 10 apr 2005, 0:00
Slackware: 14.1
Desktop: kde
Località: P.P.P.

Re: Montare il NAS

Messaggio da sunreal »

Per quanto riguarda win la situazione è quella della immagine allegata
Allegati
win-suNAS.jpg
win-suNAS.jpg (114.88 KiB) Visto 5899 volte

Avatar utente
Ansa89
Iper Master
Iper Master
Messaggi: 2703
Iscritto il: mer 29 ago 2007, 17:57
Nome Cognome: Stefano Ansaloni
Slackware: 14.2 64bit
Kernel: 4.9.61
Desktop: XFCE 4.12
Località: Modena

Re: Montare il NAS

Messaggio da Ansa89 »

rik70 ha scritto:Strano, la lista delle directory condivise te la deve dare.
Ansa89 ha scritto:
sunreal ha scritto:
Ansa89 ha scritto:La directory "Dati_recuperati" è una semplice directory del nas o è proprio uno share samba?
È una directory del nas.
Le difficioltà potrebbero essere dovute al fatto che la directory non è uno share samba?

Avatar utente
Naitso
Linux 2.x
Linux 2.x
Messaggi: 208
Iscritto il: lun 10 nov 2008, 15:09

Re: Montare il NAS

Messaggio da Naitso »

togliamoci un po' di dubbi

Codice: Seleziona tutto

nmap 192.168.1.170
in pratica controlliamo il NAS quali servizi ha aperti
e poi posta l'intero output comando compreso

sunreal
Master
Master
Messaggi: 1599
Iscritto il: dom 10 apr 2005, 0:00
Slackware: 14.1
Desktop: kde
Località: P.P.P.

Re: Montare il NAS

Messaggio da sunreal »

Eccolo qua.

Codice: Seleziona tutto

bash-4.2$ nmap 192.168.1.170

Starting Nmap 6.40 ( http://nmap.org ) at 2014-07-18 07:14 CEST
Nmap scan report for DiskStation (192.168.1.170)
Host is up (0.0024s latency).
Not shown: 990 closed ports
PORT     STATE SERVICE
80/tcp   open  http
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
515/tcp  open  printer
548/tcp  open  afp
631/tcp  open  ipp
2049/tcp open  nfs
5000/tcp open  upnp
5432/tcp open  postgresql

Nmap done: 1 IP address (1 host up) scanned in 0.10 seconds
bash-4.2$ 

Avatar utente
Naitso
Linux 2.x
Linux 2.x
Messaggi: 208
Iscritto il: lun 10 nov 2008, 15:09

Re: Montare il NAS

Messaggio da Naitso »

Bene ora puoi postare il contenuto del file /etc/samba/smb.conf ?

sunreal
Master
Master
Messaggi: 1599
Iscritto il: dom 10 apr 2005, 0:00
Slackware: 14.1
Desktop: kde
Località: P.P.P.

Re: Montare il NAS

Messaggio da sunreal »

Naitso ha scritto:Bene ora puoi postare il contenuto del file /etc/samba/smb.conf ?

Codice: Seleziona tutto

# 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 (perhaps too
# many!) most of which are not shown in this example
#
# For a step to step guide on installing, configuring and using samba, 
# read the Samba-HOWTO-Collection. This may be obtained from:
#  http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
#
# Many working examples of smb.conf files can be found in the 
# Samba-Guide which is generated daily and can be downloaded from: 
#  http://www.samba.org/samba/docs/Samba-Guide.pdf
#
# Any line which starts with a ; (semi-colon) or a # (hash) 
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# 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]

# workgroup = NT-Domain-Name or Workgroup-Name, eg: LINUX2
   workgroup = MYGROUP

# server string is the equivalent of the NT Description field
   server string = Samba Server

# 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

# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
;   hosts allow = 192.168.1. 192.168.2. 127.

# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
;  guest account = pcguest

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

# Put a capping on the size of the log files (in Kb).
   max log size = 50

# Specifies the Kerberos or Active Directory realm the host is part of
;   realm = MY_REALM

# Backend to store user information in. New installations should 
# use either tdbsam or ldapsam. smbpasswd is available for backwards 
# compatibility. tdbsam requires no further configuration.
;   passdb backend = tdbsam

# 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.
# Note: Consider carefully the location in the configuration file of
#       this line.  The included file is read at that point.
;   include = /usr/local/samba/lib/smb.conf.%m

# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
;   interfaces = 192.168.12.2/24 192.168.13.2/24 

# Where to store roving profiles (only for Win95 and WinNT)
#        %L substitutes for this servers netbios name, %U is username
#        You must uncomment the [Profiles] share below
;   logon path = \\%L\Profiles\%U

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
;   wins support = yes

# 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

# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one	WINS Server on the network. The default is NO.
;   wins proxy = yes

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The default is NO.
   dns proxy = no 

# These scripts are used on a domain controller or stand-alone 
# machine to add or delete corresponding unix accounts
;  add user script = /usr/sbin/useradd %u
;  add group script = /usr/sbin/groupadd %g
;  add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
;  delete user script = /usr/sbin/userdel %u
;  delete user from group script = /usr/sbin/deluser %u %g
;  delete group script = /usr/sbin/groupdel %g


#============================ Share Definitions ==============================
[homes]
   comment = Home Directories
   browseable = no
   writable = yes

# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
;   comment = Network Logon Service
;   path = /usr/local/samba/lib/netlogon
;   guest ok = yes
;   writable = no
;   share modes = no


# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
;[Profiles]
;    path = /usr/local/samba/profiles
;    browseable = no
;    guest ok = yes


# NOTE: If you have a BSD-style print system there is no need to 
# specifically define each individual printer
[printers]
   comment = All Printers
   path = /var/spool/samba
   browseable = no
# Set public = yes to allow user 'guest account' to print
   guest ok = no
   writable = no
   printable = yes

# This one is useful for people to share files
;[tmp]
;   comment = Temporary file space
;   path = /tmp
;   read only = no
;   public = yes

# A publicly accessible directory, but read only, except for people in
# the "staff" group
;[public]
;   comment = Public Stuff
;   path = /home/samba
;   public = yes
;   writable = no
;   printable = no
;   write list = @staff

# Other examples. 
#
# A private printer, usable only by fred. Spool data will be placed in fred's
# home directory. Note that fred must have write access to the spool directory,
# wherever it is.
;[fredsprn]
;   comment = Fred's Printer
;   valid users = fred
;   path = /homes/fred
;   printer = freds_printer
;   public = no
;   writable = no
;   printable = yes

# A private directory, usable only by fred. Note that fred requires write
# access to the directory.
;[fredsdir]
;   comment = Fred's Service
;   path = /usr/somewhere/private
;   valid users = fred
;   public = no
;   writable = yes
;   printable = no

# a service which has a different directory for each machine that connects
# this allows you to tailor configurations to incoming machines. You could
# also use the %U option to tailor it by user name.
# The %m gets replaced with the machine name that is connecting.
;[pchome]
;  comment = PC Directories
;  path = /usr/pc/%m
;  public = no
;  writable = yes

# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
;[public]
;   path = /usr/somewhere/else/public
;   public = yes
;   only guest = yes
;   writable = yes
;   printable = no

# The following two entries demonstrate how to share a directory so that two
# users can place files there that will be owned by the specific users. In this
# setup, the directory should be writable by both users and should have the
# sticky bit set on it to prevent abuse. Obviously this could be extended to
# as many users as required.
;[myshare]
;   comment = Mary's and Fred's stuff
;   path = /usr/somewhere/shared
;   valid users = mary fred
;   public = no
;   writable = yes
;   printable = no
;   create mask = 0765


Avatar utente
Naitso
Linux 2.x
Linux 2.x
Messaggi: 208
Iscritto il: lun 10 nov 2008, 15:09

Re: Montare il NAS

Messaggio da Naitso »

qualcosa continua a non tornarmi, prova:

Codice: Seleziona tutto

smbclient -L 192.168.1.170 -U [utente-su-nas]
Enter [utente-su-nas]'s password: 
e digiti la password dell'utente sul nas, le stesse credenziali che hai utilizzato per accedere via krusader

se puoi posta la schermata del NAS dove sono elencati gli utenti

sunreal
Master
Master
Messaggi: 1599
Iscritto il: dom 10 apr 2005, 0:00
Slackware: 14.1
Desktop: kde
Località: P.P.P.

Re: Montare il NAS

Messaggio da sunreal »

Naitso ha scritto:qualcosa continua a non tornarmi, prova:

Codice: Seleziona tutto

smbclient -L 192.168.1.170 -U [utente-su-nas]
Enter [utente-su-nas]'s password: 
e digiti la password dell'utente sul nas, le stesse credenziali che hai utilizzato per accedere via krusader

se puoi posta la schermata del NAS dove sono elencati gli utenti
Il mio utente sul nas si chiama in maniera mooolta imprevedibile admin. Quindi:

Codice: Seleziona tutto

bash-4.2$ smbclient -L 192.168.1.170 -U admin
Enter admin's password: 
Conversion error: Incomplete multibyte sequence(£P)
session setup failed: NT_STATUS_LOGON_FAILURE
I carattere tra parentesi £P sono gli ultimi due della sequenza di password. Boh....
Che il carattere £ non sia gradito???
Ultima modifica di sunreal il lun 21 lug 2014, 14:25, modificato 1 volta in totale.

rik70
Iper Master
Iper Master
Messaggi: 2492
Iscritto il: gio 10 mar 2011, 9:21
Slackware: 15.0
Kernel: 5.15.x-generic
Desktop: Sway
Distribuzione: Arch Linux

Re: Montare il NAS

Messaggio da rik70 »

Hai solo admin come utente del Nas?

A me viene il dubbio che prima debba creare utenti e/o gruppi e successivamente attribuirgli risorse da condividere e privilegi.

Per esempio: c'è un utente che si chiama "guest" o qualcosa di simile? Una directory 'public'?

L'utente admin dovrebbe essere limitato all'amministrazione del Nas. Ma vado ad intuito.

Ovviamente se da altre macchine riesce a montare il nas, allora come non detto: il problema è altrove.

sunreal
Master
Master
Messaggi: 1599
Iscritto il: dom 10 apr 2005, 0:00
Slackware: 14.1
Desktop: kde
Località: P.P.P.

Re: Montare il NAS

Messaggio da sunreal »

rik70 ha scritto:Hai solo admin come utente del Nas?

A me viene il dubbio che prima debba creare utenti e/o gruppi e successivamente attribuirgli risorse da condividere e privilegi.

Per esempio: c'è un utente che si chiama "guest" o qualcosa di simile? Una directory 'public'?

L'utente admin dovrebbe essere limitato all'amministrazione del Nas. Ma vado ad intuito.

Ovviamente se da altre macchine riesce a montare il nas, allora come non detto: il problema è altrove.
Uh uh... Mi sa che hai ragione. Ho creato un nuovo utente con accesso ad un paio di directory (Dati_recuperati e FAT ed ho ridato il comando
bash-4.2$ smbclient -L 192.168.1.170 -U --con il nome del novo utente (leonascasa) ecco l' output:

Codice: Seleziona tutto

bash-4.2$ smbclient -L 192.168.1.170 -U leonascasa
Enter leonascasa's password: 
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.2.8]

        Sharename       Type      Comment
        ---------       ----      -------
        IPC$            IPC       IPC Service ()
        WNDOWS_21SETTEMBRE2013 Disk      backup
        video           Disk      System default shared folder
        sette_users_leo Disk      win7_contenuto_dir_Leo
        Public          Disk      
        PISTOLA         Disk      all RR marche
        photo           Disk      System default shared folder
        OLYMPUS         Disk      multimedia da zx-2
        Nikon Transfer  Disk      le foto dalla D7000
        music           Disk      System default shared folder
        MICRO-SD_8mag2014 Disk      
        Luca            Disk      
        LEO_DOC         Disk      LEO_DOC_da_setteplus
        Leo2            Disk      
        leo14_00_22feb2013 Disk      
        I_setteplus_12nov12 Disk      
        homes           Disk      user home
        FILE_80GB       Disk      
        FAT             Disk      19nov2012
        Dati_recuperati Disk      vecchio_hdd_esterno
        ARCHIVIO_E_14-1-14 Disk      backup-del14-1
        home            Disk      home
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.2.8]

        Server               Comment
        ---------            -------
        PC-LUCA              
        DISKSTATION          

        Workgroup            Master
        ---------            -------
        WORKGROUP            PC-LUCA
bash-4.2$ 
Ho provato poi a dare il comando:
mount.cifs //192.168.1.170.........
consigliatomi da naitso e riesco ad entrare nelle directory.
Direi che posso scrivere [RISOLTO] che dite?

rik70
Iper Master
Iper Master
Messaggi: 2492
Iscritto il: gio 10 mar 2011, 9:21
Slackware: 15.0
Kernel: 5.15.x-generic
Desktop: Sway
Distribuzione: Arch Linux

Re: Montare il NAS

Messaggio da rik70 »

Bhe, se non hai altri problemi - tipo: permessi di scrittura/lettura - direi che hai risolto :)

sunreal
Master
Master
Messaggi: 1599
Iscritto il: dom 10 apr 2005, 0:00
Slackware: 14.1
Desktop: kde
Località: P.P.P.

Re: Montare il NAS

Messaggio da sunreal »

Chiedevo solop er capire se è normale che l' utente amministratore admin non è "visibile" da slack. Tutto qui.

Rispondi