# help with CIFS mount and net mount (solved)

## hedmo

hi all 

i have struggled all day to find a solution for my problems.i have manage to mount my NAS via /etc/fstab:

```

hedmo@mya51 ~ $ cat /etc/fstab | grep //

//192.168.1.1/sda1/ /media/myhdd cifs vers=2.0,uid=1000,gid=100,credentials=/home/hedmo/.cifs  0 0

hedmo@mya51 ~ $

```

it works grate without   security but if i am activating security i am getting this:

```

hedmo@mya51 ~ $ sudo mount -t cifs //192.168.1.1/sda1/  /media/myhdd  -o credentials=/home/hedmo/.cifs,vers=2.0,gid=users,uid=hedmo --verbose

mount.cifs kernel mount options: ip=192.168.1.1,unc=\\192.168.1.1\sda1,vers=2.0,uid=1000,gid=100,user=hedmo,pass=********

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)

hedmo@mya51 ~ $ dmesg | grep CIFS

[ 1019.628617] CIFS: Attempting to mount //192.168.1.1/sda1/

[ 1019.644175] CIFS VFS:  BAD_NETWORK_NAME: \\192.168.1.1\sda1

[ 1019.647147] CIFS VFS: cifs_mount failed w/return code = -2

hedmo@mya51 ~ $ 

```

i have tried different sec=krb5,sec=ntlmv2 and sec=ntlm

the second problem  i have is netmount. if i dont manually umount the NAS netmount wont stop when i shutdown the laptop.

regards hedmoLast edited by hedmo on Mon Jan 27, 2020 7:08 pm; edited 1 time in total

----------

## hedmo

Okej now i bought my self a NAS because the security problem with router .But i have almost  the same problem now.Here is some info if someone can help.

I bought a qnap nas ts 209 pro 2 , installed debian on it and want to run it with samba for sharing all over my network.my smb.conf looks like this:

```

root@MYNAS:/home/hedmo# cat  /etc/samba/smb.conf       

[global]

# Configure correct UTP

  unix charset = UTF-8

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

   workgroup = WORKGROUP

   interfaces = 127.0.0.0/8 eth0

   bind interfaces only = yes

# Set share configuration at the end

[Docs]

   path = /home/share

   writable = yes

   guest ok = yes

   guest only = yes

   create mode = 0777

   directory mode = 0777

[hedmo]

    path = /home/share/hedmo

    read only = no

    writeable = yes

    browseable = yes

    force create mode = 0660

    force directory mode = 2770

    valid users = @hedmo @sambashare

[smbadmin]

    path = /home/share/smbadmin

    available = yes

    read only = no

    browseable = yes

    public = yes

    #force create mode = 0660

    #force directory mode = 2770

    #valid users = @sambashare @smbadmin

root@MYNAS:/home/hedmo# 

```

The samba share works in win10 in virtualbox guest but not my gentoo host.Here is the command i am trying to get it to work with:

```

mya51 /home/hedmo # mount -t cifs //192.168.1.89/home/share/hedmo /mnt/disk -o user=hedmo,sec=ntlm,vers=1.0 --verbose

Password for hedmo@//192.168.1.89/home/share/hedmo: 

mount.cifs kernel mount options: ip=192.168.1.89,unc=\\192.168.1.89\home,sec=ntlm,vers=1.0,user=hedmo,prefixpath=share/hedmo,pass=********

mount error(13): Permission denied

Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

mya51 /home/hedmo # 

```

and dmesg:

```

[90673.308224] CIFS: Attempting to mount //192.168.1.89/home/share/hedmo

[90673.393608] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE

[90673.393613] CIFS VFS: \\192.168.1.89 Send error in SessSetup = -13

[90673.393617] CIFS VFS: cifs_mount failed w/return code = -13

```

if one can provide a better/simpler option i am all for it.

Edit:Solved by change vers=1.0 to  vers=2.1

regards hedmo

----------

