Cannot mount Pi-hosted samba share

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
nugget
Posts: 5
Joined: Wed Jul 28, 2021 3:23 pm

Cannot mount Pi-hosted samba share

Post by nugget »

Solution at the end

I am unable to mount the samba share. I installed through dietpi-software. My smb.conf is as follows:

Code: Select all

[global]

        workgroup = WORKGROUP
        server string = %h server
        dns proxy = no
        log file = /var/log/samba/log.%m
        max log size = 1000
        syslog only = no
        syslog = 0

        panic action = /usr/share/samba/panic-action %d

        security = user
        encrypt passwords = true
        passdb backend = tdbsam
        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

        load printers = no
        printcap name = /dev/null
        disable spoolss = yes

[dietpi]
        comment = DietPi Share
        path = /mnt/dietpi_userdata
        browseable = yes
        create mask = 0664
        directory mask = 0775
        valid users = dietpi
        writeable = yes
max connections = 8


Output of

Code: Select all

ls -la /mnt/dietpi_userdata
is

Code: Select all

total 28
drwxrwxr-x 7 dietpi    dietpi    4096 Jul 27 21:45 .
drwxr-xr-x 7 root      root      4096 Jul 29 03:45 ..
drwxrwxr-x 2 dietpi    dietpi    4096 Jul 27 21:55 Music
drwxrwxr-x 2 dietpi    dietpi    4096 Oct 30  2020 Pictures
drwxrwxr-x 2 dietpi    dietpi    4096 Oct 30  2020 Video
drwxrwxr-x 2 dietpi    dietpi    4096 Oct 30  2020 downloads
drwxr-xr-x 4 octoprint octoprint 4096 Feb 27 22:31 octoprint

When I try to connect from the finder on the Mac I get:
There was a problem connecting to the server "dietpi"
There server may not exist or it is unavailable at this time. Check the server name or IP address, check your network connection, and try again.


When I try to connect with the "go to server" function in the finder with smb://192.168.1.179/dietpi (edited) it will not let me authenticate with the user dietpi and associated password.

I am able to ssh into the device no problem. I did try restarting smb service and restarting the pi.

If anybody can point me in the right direction it would be appreciated.
Cheers

Edit to include copy of /etc/fstab

Code: Select all

# You can use "dietpi-drive_manager" to setup mounts.
# NB: It overwrites and re-creates physical drive mount entries on use.
#----------------------------------------------------------------
# NETWORK
#----------------------------------------------------------------
//192.168.1.180/Music /mnt/samba cifs cred=/var/lib/dietpi/dietpi-drive_manager/mnt-samba.cred,ioch$

#----------------------------------------------------------------
# TMPFS
#----------------------------------------------------------------
tmpfs /tmp tmpfs size=1024M,noatime,lazytime,nodev,nosuid,mode=1777
tmpfs /var/log tmpfs size=50M,noatime,lazytime,nodev,nosuid,mode=1777

#----------------------------------------------------------------
# MISC: ecryptfs, vboxsf (VirtualBox shared folder), gluster, bind mounts
#----------------------------------------------------------------


#----------------------------------------------------------------
# SWAP SPACE
#----------------------------------------------------------------
/var/swap none swap sw

#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
PARTUUID=907af7d0-02 / ext4 noatime,lazytime,rw 0 1
PARTUUID=907af7d0-01 /boot vfat noatime,lazytime,rw 0 2
Solution:

Code: Select all

sudo smbpasswd -a USERNAME
Then restart samba service
Last edited by nugget on Tue Aug 03, 2021 4:02 am, edited 3 times in total.
User avatar
Joulinar
Posts: 5996
Joined: Sat Nov 16, 2019 12:49 am

Re: Cannot mount Pi-hosted samba share

Post by Joulinar »

Hi

Not sure how it is on Mac but probably you would need to specify the share name as follows 192.168.1.179/dietpi

Did you tried using an SMB App on a mobile device to check if it is working there?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
nugget
Posts: 5
Joined: Wed Jul 28, 2021 3:23 pm

Re: Cannot mount Pi-hosted samba share

Post by nugget »

Hey thanks for dropping in.

I have tried smb://192.168.1.179/dietpi and it does not seem to let me authenticate with user dietpi.

I am unable to connect from android either. I don't know how to start diagnosing this. I really wonder if there is something wrong with my smb.conf or is there a firewall problem from the pi side?

I updated my post include copy of /etc/fstab.
nugget
Posts: 5
Joined: Wed Jul 28, 2021 3:23 pm

Re: Cannot mount Pi-hosted samba share

Post by nugget »

I found the solution see OP
User avatar
Joulinar
Posts: 5996
Joined: Sat Nov 16, 2019 12:49 am

Re: Cannot mount Pi-hosted samba share

Post by Joulinar »

does this mean you changed the SAMBA user password? What password did you specify? Usually this would not needed and you should be able to connect out of the box. At least this is how it is working on Windows.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply