Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Cannot mount Samba share from Ubuntu or Android

  1. #1
    Join Date
    Sep 2021
    Beans
    13

    Cannot mount Samba share from Ubuntu or Android

    I cant find anywhere else to ask this so if anyone knows of a more appropriate forum please let me know .(I was unable to find a 'Samba User Forum') .

    My environment

    KDE NEON 5.22 User Edition
    CIFS Version 2.23
    samba/focal-updates,now 2:4.11.6+dfsg-0ubuntu1.10 amd64

    All I am trying to do is share via Samba a single folder to a single user .
    Here is my smb.conf

    [global]
    netbios name = OLLIES
    workgroup = OLLIE-SAMBA
    security = user
    passdb backend = tdbsam
    server string = %h server (Samba, Ubuntu)
    log file = /var/log/samba/log.%m
    max log size = 1000
    logging = file
    panic action = /usr/share/samba/panic-action %d
    log level = 3
    server role = standalone server
    obey pam restrictions = no
    unix password sync = no
    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 = no
    map to guest = bad user
    usershare allow guests = no
    usershare path =

    [LinuxShare]
    path = /Share
    valid users = neon
    guest ok = no
    read only = no
    available = yes
    writable = yes
    public = no
    printable = no
    locking = yes
    strict locking = no
    create mask = 0644
    directory mask = 0755

    After starting Samba I seem my share


    Sharename Type Comment
    --------- ---- -------
    LinuxShare Disk
    IPC$ IPC IPC Service (linux-desktop server (Samba, Ubuntu))

    So here is where the problem starts . First I attempt to access the share from an Android machine . Ii looks as though I am being authenticated OK

    smbstatus

    Samba version 4.11.6-Ubuntu
    PID Username Group Machine Protocol Version Encryption Signing
    ----------------------------------------------------------------------------------------------------------------------------------------
    221522 neon neon 10.10.10.221 (ipv4:10.10.10.221:36687) SMB2_10 - partial(HMAC-SHA256)

    Service pid Machine Connected at Encryption Signing
    ---------------------------------------------------------------------------------------------
    IPC$ 221522 10.10.10.221 Tue Sep 7 01:49:35 PM 2021 EDT - HMAC-SHA256

    However when I attempt to browse into the share or create a file in it I get

    Error Invalid smb status:STATUS_ACCESS_DENIED

    On the Android tab I am using the app "X-plore"

    So if I go to the Linux host and attempt to do this

    mount -t cifs -o vers=3.0,username=neon //localhost/LinuxShare /mnt01
    Password for neon@//localhost/LinuxShare: *******

    I get this

    mount error(13): Permission denied
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)


    dmesg -T shows me this

    [Tue Sep 7 14:03:07 2021] CIFS: Attempting to mount //localhost/LinuxShare
    [Tue Sep 7 14:03:07 2021] CIFS VFS: cifs_mount failed w/return code = -13

    Here are the perms for the share and mount point

    ls -ld /Share
    drwxr-xr-x 1 neon neon 0 Sep 7 08:22 /Share

    ls -ld /mnt01
    drwxr-xr-x 2 neon neon 4096 Mar 16 12:15 /mnt01

    The other odd thing is I can enable my home directory in smb.conf and that works . I can connect , read and write files etc with no complaints .

    If I su to 'neon' on the samba host I have full access to /Share and /mnt01


    any help , ideas would be appreciated

    This has to be something easy that I just dont see

  2. #2
    Join Date
    Dec 2009
    Beans
    6,569

    Re: Cannot mount Samba share from Ubuntu or Android

    It's going to take me a bit to go through all that but there is one thing missing from what it a fairly extensive set of detail and that is the samba password.

    You never mentioned creating it. Did you set a samba password for neon:
    Code:
    sudo smbpasswd -a neon
    That would explain at least this part of your description:
    mount -t cifs -o vers=3.0,username=neon //localhost/LinuxShare /mnt01
    Password for neon@//localhost/LinuxShare: *******

    I get this

    mount error(13): Permission denied
    THe samba password can be the same as your local login password but you must add it to the samba password database.

    EDIT: Note that if successful you will not have write access to that mount but that can be fixed later.
    Last edited by Morbius1; September 7th, 2021 at 07:43 PM.

  3. #3
    Join Date
    Sep 2021
    Beans
    13

    Re: Cannot mount Samba share from Ubuntu or Android

    user 'neon' created with smbpasswd

    see

    smbstatus

    Samba version 4.11.6-Ubuntu
    PID Username Group Machine Protocol Version Encryption Signing
    ----------------------------------------------------------------------------------------------------------------------------------------
    221522 neon neon 10.10.10.221 (ipv4:10.10.10.221:36687) SMB2_10 - partial(HMAC-SHA256)

  4. #4
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,445

    Re: Cannot mount Samba share from Ubuntu or Android

    In my experience, the best way to debug samba issues is from the command line with smbclient. The error messages will tell you exactly what the matter is and if smbclient doesn’t work, any other method won’t either.

  5. #5
    Join Date
    Dec 2009
    Beans
    6,569

    Re: Cannot mount Samba share from Ubuntu or Android

    Not doing very well here.

    I made my smb.conf your smb.conf.
    Changed neon to tester
    Created the /Share directory w/tester as owner.
    Mounted the share to my Test directory:
    tester@vxub2004:~$ sudo mount -t cifs -o vers=3.0,username=tester,uid=tester //localhost/LinuxShare /home/tester/Test
    [sudo] password for tester:
    Password for tester@//localhost/LinuxShare: *****
    Added a file:
    tester@vxub2004:~$ touch Test/forum-test.txt
    Seems to work for me:
    tester@vxub2004:~$ ls -l /Share
    total 0
    -rw-r--r-- 1 tester tester 0 Sep 7 15:37 forum-test.txt

  6. #6
    Join Date
    Sep 2021
    Beans
    13

    Re: Cannot mount Samba share from Ubuntu or Android

    I took the suggestion to play with smbclient and this is what I got

    Code:
    root@linux-desktop:~# smbclient -d3 '\\linuxdesktop\LinuxShare' -U neon 
    lp_load_ex: refreshing parameters 
    Initialising global parameters 
    rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) 
    Processing section "[global]" 
    added interface enp7s0 ip=fd05:92d7:663f::216 bcast= netmask=ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 
    added interface enp7s0 ip=fd05:92d7:663f:0:189:2c3d:bab3:1076 bcast= netmask=ffff:ffff:ffff:ffff:: 
    added interface enp7s0 ip=fd05:92d7:663f:0:2154:7f9:f5e6:a9a1 bcast= netmask=ffff:ffff:ffff:ffff:: 
    added interface enp7s0 ip=fd05:92d7:663f:0:a450:3284:e82b:7619 bcast= netmask=ffff:ffff:ffff:ffff:: 
    added interface enp7s0 ip=10.10.10.249 bcast=10.10.10.255 netmask=255.255.255.0 
    Client started (version 4.11.6-Ubuntu). 
    resolve_lmhosts: Attempting lmhosts lookup for name linuxdesktop<0x20> 
    resolve_wins: WINS server resolution selected and no WINS servers listed. 
    resolve_hosts: Attempting host lookup for name linuxdesktop<0x20> 
    Connecting to 10.10.10.249 at port 445 
    Enter WORKGROUP\neon's password:  
    Kinit for neon@WORKGROUP to access linuxdesktop failed: Cannot contact any KDC for requested realm 
    GENSEC backend 'gssapi_spnego' registered 
    GENSEC backend 'gssapi_krb5' registered 
    GENSEC backend 'gssapi_krb5_sasl' registered 
    GENSEC backend 'spnego' registered 
    GENSEC backend 'schannel' registered 
    GENSEC backend 'naclrpc_as_system' registered 
    GENSEC backend 'sasl-EXTERNAL' registered 
    GENSEC backend 'ntlmssp' registered 
    GENSEC backend 'ntlmssp_resume_ccache' registered 
    GENSEC backend 'http_basic' registered 
    GENSEC backend 'http_ntlm' registered 
    GENSEC backend 'http_negotiate' registered 
    GENSEC backend 'krb5' registered 
    GENSEC backend 'fake_gssapi_krb5' registered 
    Got challenge flags: 
    Got NTLMSSP neg_flags=0x628a8215 
    NTLMSSP: Set final flags: 
    Got NTLMSSP neg_flags=0x62088215 
    NTLMSSP Sign/Seal - Initialising with flags: 
    Got NTLMSSP neg_flags=0x62088215 
    NTLMSSP Sign/Seal - Initialising with flags: 
    Got NTLMSSP neg_flags=0x62088215 
    tree connect failed: NT_STATUS_ACCESS_DENIED
    I dont know if the kinit error means anything since kerb is not installed .
    The 'NT_STATUS_ACCESS_DENIED' error is telling me I have authenticated but are not allowed to do what I am attempting .
    That does not give me any more of a clue .

    I deleted and re-created samba user 'neon' but it didnt help
    Last edited by deadflowr; September 8th, 2021 at 07:45 PM. Reason: added code tags

  7. #7
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Cannot mount Samba share from Ubuntu or Android

    I know very little about Samba management, but this idea might possibly help.

    Recently I have revived an old tool which I have used in past local development.

    Webmin

    This can be found in Ubuntu Synaptic or follow the manual installation guide.

    https://www.digitalocean.com/communi...n-ubuntu-20-04

    Now I know that the veterans in this forum frown on any GUI tool which does not follow the Unix way - and particularly so if it opens up a port 10000. But Webmin allows me to do keyhole surgery when my desktop is in a mess. Or just to fine tune performance.

    Precautions I take are to limit use to my desktop, and to close down Webmin when not in use.

    Now to Samba.

    Assuming you decide to take the step of installing Webmin, then proceed to Servers > Samba Windows File Sharing.

    There you will find a wealth of tools to troubleshoot your problems.

    If you decide to retain Webmin there are steps to change its certificate to Let's Encrypt to avoid the warning note you see when starting Webmin with its default self signed certificate.

  8. #8
    Join Date
    Mar 2007
    Location
    Denver, CO
    Beans
    7,915
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Cannot mount Samba share from Ubuntu or Android

    Only one thing I can suggest since I've had all types of problems with my Samba mounts -- In your configuration:
    workgroup = OLLIE-SAMBA

    change that to
    workgroup = WORKGROUP

    You can kind of see this in your other post:
    Enter WORKGROUP\neon's password:
    Kinit for neon@WORKGROUP to access linuxdesktop failed: Cannot contact any KDC for requested realm

  9. #9
    Join Date
    Sep 2021
    Beans
    13

    Re: Cannot mount Samba share from Ubuntu or Android

    For 'fun' I installed webmin , deleted the share , added it back and ended up with the same error . I think this issue is external to samba but I have no clue as to what it might be

  10. #10
    Join Date
    Dec 2009
    Beans
    6,569

    Re: Cannot mount Samba share from Ubuntu or Android

    I don't want to waste your time but did you just not print the whole smb.conf or is this really in there:
    usershare path =
    Samba defaults to /var/lib/samba/usershares and is usually not explicitly stated in smb.conf. Did you set the path to another location?

    If you did you might want to see if you "double" shared the /Share folder:
    Code:
    net usershare info --long
    You can share your home directory without issue but not this one folder and ... um ... I'm just trying to make sense of that.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •