0

Can anyone give some knowledge of why ubuntu client is giving me the mounting error when trying to locally mount a remote samba share with cifs ? I'm able to access all the shares on the clients file explorer through network but not to mount a local share. Any idea why ?? Presenting here all the configs


The error:

mount -a
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

ubuntu@client:/# cat /etc/fstab 

//192.168.3.1/comercial   /mnt/comercial   cifs    rw,username=marta,password=Passw0rd,uid=1005,gid=1005    0   0
//192.168.3.1/it    /mnt/it cifs    rw,username=marta,password=Passw0rd,uid=1005,gid=1005   0   0

ubuntu@client:/mnt# ll
total 40
drwxr-xr-x 10 root  root  4096 dez 12 21:57 ./
drwxr-xr-x 20 root  root  4096 out  3 14:58 ../
drwxrwx---  2 marta marta 4096 dez 12 17:41 comercial/
drwxrwx---  2 marta marta 4096 dez 12 17:41 it/

root@server:/# cat /etc/fstab (Permanent mount on Server)
# /etc/fstab: static file system information.

#HDD3
/dev/disk/by-uuid/2868d2bf-d1d4-495e-90e3-63f0b04f8027  /mnt/hddextra/contabilidade ext4    rw  0   0
/dev/disk/by-uuid/b98fe068-526b-4f87-b392-2ce93ebebadd  /mnt/hddextra/logistica ext4    rw  0   0
/dev/disk/by-uuid/33d55b1b-7ecc-44ad-a02a-b3016652c2ef  /mnt/hddextra/comercial ext4    rw  0   0
/dev/disk/by-uuid/3b7d60f4-e089-454f-9df2-a0e5da79cd2e  /mnt/hddextra/it    ext4    rw  0   0
/dev/disk/by-uuid/42046503-c958-432c-9a4f-74781c13f4e6  /mnt/hddextra/administracao ext4    rw  0   0

root@server:/mnt# lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
├─sda1                      8:1    0    1M  0 part 
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0   19G  0 part 
  └─ubuntu--vg-ubuntu--lv 253:0    0   19G  0 lvm  /
├─sdc1                      8:33   0  205M  0 part /mnt/hddextra/contabilidade
├─sdc2                      8:34   0  205M  0 part /mnt/hddextra/logistica
├─sdc3                      8:35   0  205M  0 part /mnt/hddextra/comercial
├─sdc4                      8:36   0  205M  0 part /mnt/hddextra/it
└─sdc5                      8:37   0  202M  0 part /mnt/hddextra/administracao

root@server:/mnt# ll /mnt/hddextra/
total 32
drwxr-xr-x 7 samba         samba         4096 Dec 12 22:14 ./
drwxr-xr-x 6 root          root          4096 Dec 12 21:39 ../
-rw-r--r-- 1 root          root          1024 Dec 12 22:14 .pdbedit.swp
drwxrwx--- 3 administracao administracao 4096 Dec 12 16:14 administracao/
drwxrwx--- 3 comercial     comercial     4096 Dec 12 16:14 comercial/
drwxrwx--- 3 contabilidade contabilidade 4096 Dec 12 16:14 contabilidade/
drwxrwx--- 3 it            it            4096 Dec 12 16:14 it/
drwxrwx--- 3 logistica     logistica     4096 Dec 12 16:14 logistica/

root@server:/# smbclient -L 192.168.3.1
Enter CET53\root's password: 

    Sharename       Type      Comment
    ---------       ----      -------
    print$          Disk      Printer Drivers
    publica         Disk      Partilha publica
    privada         Disk      Partilha privada
    contabilidade   Disk      Partilha Contabilidade
    logistica       Disk      Partilha Logistica
    comercial       Disk      Partilha Comercial
    it              Disk      Partilha it
    administracao   Disk      Partilha Administracao
    IPC$            IPC       IPC Service (cet53server server (Samba, Ubuntu))
SMB1 disabled -- no workgroup available

===========================================================

smb.conf: (none of the shares are mounting on the client)

[administracao]
comment = Partilha Administracao
browseable = yes
path = /mnt/hddextra/administracao
guest ok = no
read only = yes
valid users = @administracao
write list = rita, mario
force group = administracao
#force user = empresa
force create mode = 0770
security mask = 0770
create mask = 0770
directory mask = 0770

===================================================

[global]

   workgroup = CET53
   server string = %h server (Samba, Ubuntu)

#### Networking ####

;   interfaces = 127.0.0.0/8 eth0   
;   bind interfaces only = yes

#### Debugging/Accounting ####

   log file = /var/log/samba/log.%m
   max log size = 1000
   logging = file
   panic action = /usr/share/samba/panic-action %d


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

   server role = standalone server
   obey pam restrictions = yes
   unix password sync = yes.
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user

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

   usershare allow guests = yes

===========================================

(All the users belong to the right groups)



(Last 2 log lines of /var/log/samba/log.«clientmachine»

[2020/12/13 17:25:17.161291,  0] ../../lib/param/loadparm.c:800(lpcfg_map_parameter)
  Unknown parameter encountered: "security mask"
[2020/12/13 17:25:17.161319,  0] ../../lib/param/loadparm.c:1859(lpcfg_do_service_parameter)
  Ignoring unknown parameter "security mask"



 ===================================================================
    


      Again, all is fine when browsing directories on network file explorer:
 smb://192.168.3.1
Except client won´t mount shares locally with cifs.

 
    
    The following lines are an mounting attempt with a Debian machine:
    (It gives a different error)

marco@debian:~# mount -t cifs //192.168.3.1/it /mnt/it
Password for root@//192.168.3.1/it:  ********
mount error(112): Host is down
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


The following lines are a mounting attempt with ubuntu client:

Password for root@//192.168.3.1/contabilidade/: 
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
Password for root@//192.168.3.1/logistica/:  ********                
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
3
  • Please include the non-comment lines from your smb.conf on the server. Particularly the [global] section and one of the two problematic share sections (if they're the same you don't need to show us both). Also please look in the Samba log files on the server for errors related to the mount attempt - this is the place that most likely will identify the issue for you – roaima Dec 13 '20 at 8:38
  • Is marta in the administracao group? – roaima Dec 13 '20 at 19:16
  • Thank you. Under /var/log/samba on the server are a number of logs. Try the mount from the client once more. You should see (ls -lt) that one with a filename that matches the client IP address or name has been very recently updated. Scroll down to the end where you should see some "permission denied" style messages. (They probably won't be using that text - you will have to look for something with simialr meaning.) Does it give you a clue to the reason? If you're not sure, please add the last block - entries with a timestamp matching your most recent failed mount attempt - to your question – roaima Dec 14 '20 at 10:45
1

Answer found: port 445 was closed on server. So lame... for some reason had opened ports 137, 138, 139 AND «443» (https)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.