OpenWrt Forum Archive

Topic: Networkshares - Permission Denied

The content of this topic has been archived on 29 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi there,
I've got a problem with the Samba Server on my Router Linksys WRT1900ACS.
With the stock-fw the sharing runs very well.
But with the  OpenWrt Chaos Calmer 15.05.1   image I am getting each time when I try to open the share folder a 'Permission denied'.
The USB3-HDD (3TB/2.7TiB) is mounted correctly, I can access it via ssh (of course I don't mean SFTP) but not through the Windoof Explorer, so I tried Linux Mint - and -- same Problem.
I used this Howto to set up the sharing: *klick*

Can anyone help me to fix this?

Best regards,
matze smile

There are prerequisites of Basic USB support, USB Storage, Samba, and Samba How To (follow the links) which you should confirm you have also followed.  If you did not create firewall rules or permissions you missed something.  Probably want to see this if you have NTFS running:  https://wiki.openwrt.org/doc/howto/writable_ntfs

List the packages you installed for USB support including the file system and how your device is formatted. 

NTFS has been reported to be slooow.  If you expect this to be a NAS, with any file system, you will probably be disappointed.  Search the forum for NAS.

I never got NTFS working and only now use USB devices on my travel routers, mostly for media streaming.

oh, I've forgotten to tell you, that I formatted the HDD with ext4.
Packages for USB-Support, that are installed on my Router:

-block-mount
-kmod-fs-ext4
-kmod-usb-core
-kmod-usb-storage
-kmod-usb2
-kmod-usb3
-luci-app-samba
-luci-i18n-samba-de
-samba36-server

But I didn't create firewall rules, because I don't know which ...

This does not look like a firewall / mount problem, but a SAMBA misconfiguration; please post your configuration files here.

I also install either kmod-usb-ohci or kmod-usb-uhci depending on the hardware, but I think these are usb1.1 and that you may have it covered with kmod-usb-2.

The firewall rules are here http://wiki.openwrt.org/doc/howto/cifs.server

Like ed says, post your configs.

These are my Config-Files, I only edited them via LuCI:
/etc/config/samba

config samba
        option name 'OpenWrt'
        option charset 'UTF-8'
        option interface 'loopback lan'
        option description 'OpenWrt'
        option workgroup 'Workgroup'
        option homes '1'

config sambashare
        option name 'Elements'
        option path '/mnt'
        option read_only 'no'
        option guest_ok 'yes'

/etc/samba/smb.conf.template

[global]
    netbios name = |NAME| 
    display charset = |CHARSET|
    interfaces = |INTERFACES|
    server string = |DESCRIPTION|
    unix charset = |CHARSET|
    workgroup = |WORKGROUP|
    browseable = yes
    deadtime = 30
    domain master = yes
    encrypt passwords = true
    enable core files = no
    guest account = nobody
    guest ok = yes
    invalid users = root
    local master = yes
    load printers = no
    map to guest = Bad User
    max protocol = SMB2
    min receivefile size = 16384
    null passwords = yes
    obey pam restrictions = yes
    os level = 20
    passdb backend = smbpasswd
    preferred master = yes
    printable = no
    security = user
    smb encrypt = disabled
    smb passwd file = /etc/samba/smbpasswd
    socket options = TCP_NODELAY IPTOS_LOWDELAY
    syslog = 2
    use sendfile = yes
    writeable = yes
    

Files seem ok... did you remember to create the "guest" account?

ok, I added the user 'guest'. firstly to the system, then to samba.
I still get a Permission Denied.

When you try to connect, do you see anything in the logs at the router?

Please also post your fstab file

I have the following lines for permissions in each section of my "config sambashare"
    option create_mask '0700'
    option dir_mask '0700'
https://wiki.openwrt.org/doc/uci/samba

I'm not sure this will help, but i had a similar problem with an ext4 drive connected to my WRT1200 running CC 15.05.1, got permission denied when i tried to do anything, nothing i did with Samba corrected the problem, so i disconnected the drive from my WRT1200 and connected it to my linux  laptop and checked permissions, root was owner and had full permissions, root was group and and had access/read permission, so i changed owner to myself and group to myself with same permissions, hooked it back up to my WRT1200 and it worked fine.

Thanks, the permissions were the problem
==SOLVED==

smile

The discussion might have continued from here.