Android to Raspberry Pi

Support for Android version of Total Commander

Moderators: Hacker, petermad, Stefan2, white

sheepdoggie
Junior Member
Junior Member
Posts: 8
Joined: 2025-02-02, 02:44 UTC

Android to Raspberry Pi

Post by *sheepdoggie »

I have a Samba share on my raspberry pi, which my computers connect with without problem. Total Commander on my Samsung tablet connects to the raspberry pi, but cannot enter the directory. Total Commander shows the directory but when click on the directory it returns the error Access Denied. Please advise.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Android to Raspberry Pi

Post by *ghisler(Author) »

It sounds like a permission issue. Did you enter a user name and password in the LAN plugin for this connection? Otherwise the plugin will connect as a guest user, who has very limited permissions.
Author of Total Commander
https://www.ghisler.com
sheepdoggie
Junior Member
Junior Member
Posts: 8
Joined: 2025-02-02, 02:44 UTC

Re: Android to Raspberry Pi

Post by *sheepdoggie »

Yes, username and password were provided and, again, Total Commander does appear to connect and list the directory structure, but does not allow me to open the directory -- which is no problem on my computers.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Android to Raspberry Pi

Post by *ghisler(Author) »

I have a Pi5 with the current Raspberry PI OS 12 (bookworm). I didn't have Samba installed on it yet, so I followed these steps to install it:
https://pimylifeup.com/raspberry-pi-samba/

First I tried to share /home/chris/Downloads, but this didn't work, and then I followed the instructions and created a new subfolder "shared". I then added my PI user name, and this way I can access both "shared" and my home folder. I can go to subdirectories in both of them, create new ones, add files etc. This works fine both from Windows and Android.

Therefore something must be wrong with your smb.conf. Maybe you can spot the difference when comparing to mine below. I only added the [shared] section to the end:

Code: Select all

#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which 
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
#  - When such options are commented with ";", the proposed setting
#    differs from the default Samba behaviour
#  - When commented with "#", the proposed setting is the default
#    behaviour of Samba but the option is considered important
#    enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic 
# errors. 

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

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

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
;   interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself.  However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
;   bind interfaces only = yes

#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
   max log size = 1000

# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}.
# Append syslog@1 if you want important messages to be sent to syslog too.
   logging = file

# Do something sensible when Samba crashes: mail the admin a backtrace
   panic action = /usr/share/samba/panic-action %d


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

# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller". 
#
# Most people will want "standalone server" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
   server role = standalone server

   obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
   unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
   pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
   map to guest = bad user

########## Domains ###########

#
# The following settings only takes effect if 'server role = classic
# primary domain controller', 'server role = classic backup domain controller'
# or 'domain logons' is set 
#

# It specifies the location of the user's
# profile directory from the client point of view) The following
# required a [profiles] share to be setup on the samba server (see
# below)
;   logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
#   logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
;   logon drive = H:
#   logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
;   logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe.  The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/useradd --create-home %u

# This allows machine accounts to be created on the domain controller via the 
# SAMR RPC pipe.  
# The following assumes a "machines" group exists on the system
; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.  
; add group script = /usr/sbin/addgroup --force-badname %g

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

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
;   include = /home/samba/etc/smb.conf.%m

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
;   idmap config * :              backend = tdb
;   idmap config * :              range   = 3000-7999
;   idmap config YOURDOMAINHERE : backend = tdb
;   idmap config YOURDOMAINHERE : range   = 100000-999999
;   template shell = /bin/bash

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 means that usershare is disabled.
#   usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
   usershare allow guests = yes

#======================= Share Definitions =======================

[homes]
   comment = Home Directories
   browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
   read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
   create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
   directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# This might need tweaking when using external authentication schemes
   valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   read only = yes

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700

[printers]
   comment = All Printers
   browseable = no
   path = /var/tmp
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin

[shared]
path = /home/chris/shared
writeable = yes
browseable = yes
public = no
Author of Total Commander
https://www.ghisler.com
sheepdoggie
Junior Member
Junior Member
Posts: 8
Joined: 2025-02-02, 02:44 UTC

Re: Android to Raspberry Pi

Post by *sheepdoggie »

I have compared my smb.conf with yours and cannot identify any significant differences. Here is the part that shares the directory:

Code: Select all

# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin
[Media]
path = /media/pi/FLASH1/media
available = yes
valid users = pi
read only = no
browsable = yes
public = yes
writable = yes
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Android to Raspberry Pi

Post by *ghisler(Author) »

Try setting
public = no
otherwise you allow guests in read only mode. This means that when the LAN plugin fails to login with the given user and password, it logs in as guest.
Author of Total Commander
https://www.ghisler.com
sheepdoggie
Junior Member
Junior Member
Posts: 8
Joined: 2025-02-02, 02:44 UTC

Re: Android to Raspberry Pi

Post by *sheepdoggie »

No change. The problem persists after setting public= no.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Android to Raspberry Pi

Post by *ghisler(Author) »

1. Which operating system and version do you use on the PI? Use the command
cat /etc/os-release

2. Which Samba version? Use
smbstatus --version
or
smbd -V
Author of Total Commander
https://www.ghisler.com
sheepdoggie
Junior Member
Junior Member
Posts: 8
Joined: 2025-02-02, 02:44 UTC

Re: Android to Raspberry Pi

Post by *sheepdoggie »

pi@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

pi@raspberrypi:~ $ smbd -V
Version 4.13.13-Debian
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Android to Raspberry Pi

Post by *ghisler(Author) »

OK, I'm already using the successor, version 12 (bookworm) with smbd version 4.17.12.
I don't have any system with version 11, but with version 10 and smbd 3.9.5. With this I can access subdirs just fine, and also upload and download files.

I would really check the permissions and the owner of the problem folders.
Author of Total Commander
https://www.ghisler.com
sheepdoggie
Junior Member
Junior Member
Posts: 8
Joined: 2025-02-02, 02:44 UTC

Re: Android to Raspberry Pi

Post by *sheepdoggie »

It is the media directory.
[img]file:///home/mel/Downloads/Screenshot%20from%202025-02-17%2006-38-17.png[/img]

I do not see how to insert an image in this editor.

Permissions are rxwr-xr-x and the owner is pi.
JOUBE
Power Member
Power Member
Posts: 1664
Joined: 2004-07-08, 08:58 UTC

Re: Android to Raspberry Pi

Post by *JOUBE »

1.
sheepdoggie wrote: 2025-02-17, 15:03 UTC It is the media directory.
Do you mean the folder /media ? Just try at first another folder (eg. /home/pi/media or so *) (a folder at your home directory)). Because /media is a special folder, where usb-sticks and so on **) are automaticly mounted (depends from configuration). Without having tested it, maybe this is a problem...

*) Or in the case of extenal devices try subfolder of /mnt with settings within ftab.

**) CD/DVD/externalSSD/USB-Stick, ...

2. Often the settings within smb.conf outside of the section [YourShareName] *) affects the settings **) within section [YourShareName]. So try ghisler(author)'s complete smb.conf with only change the [YourShareName] and YourPath.

*) eg. section [global]

**) Settings : security = ? , browseable = ? , ...

3. Try set the rights to rwxrwxrwx (which is standard setting for samba shares, IIRC)

HTH

Joube
sheepdoggie
Junior Member
Junior Member
Posts: 8
Joined: 2025-02-02, 02:44 UTC

Re: Android to Raspberry Pi

Post by *sheepdoggie »

I have 2 linux computers that have no trouble connecting to the samba share with the existing smb.conf on the raspberry pi. But my one android tablet and one android phone, cannot connect to the pi share using any app that I have tried. Except that, on the tablet only, Total Commander does connect, but will not enter the directory, giving the error ACCESS DENIED. Monkeying with a working smb.conf does not seem warranted. This problem appears to be an Android-specific issue.
JOUBE
Power Member
Power Member
Posts: 1664
Joined: 2004-07-08, 08:58 UTC

Re: Android to Raspberry Pi

Post by *JOUBE »

I have now recreated such a configuration (bullseye on Rpi 4B+) and can easily access the share from an Android 14 smartphone (read/write/copy(etc) via Android-Tc and its LAN-Plugin and also other systems (windows/...):

RaspberryPi 4B+:

Code: Select all

$ cat /etc/*release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Code: Select all

$ uname -a
Linux RpiX 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

Code: Select all

$ smbd -V
Version 4.13.13-Debian

Code: Select all

$ testparm -s
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed
Server role: ROLE_STANDALONE

# Global parameters
[global]
        security = USER
        workgroup = SAMBA
        idmap config * : backend = tdb
        include = /etc/samba/usershares.conf


[RpiShare]
        comment = rpi smb share
        path = /home/pi/samba_share/
        read only = No
Hints:
- No file /etc/samba/usershares.conf
- $ = user prompt (# = root prompt)

Please post here your complete result of $ testparm -s
(As a part of samba package testparm is the validation tool for samba.conf with all active lines)

Additional information about rights (So I'm not right with my opinion about rights some posts above):

Code: Select all

~ $ ls -l 
drwxr-xr-x  4 pi   pi   4096 18. Feb 10:53 samba_share
Required:

Code: Select all

$ sudo smbpasswd -a pi
 <password>
Hint: This does not have to be the same as at the account of user pi.

Do not forget:

Code: Select all

$ sudo systemctl restart smbd
Samsung Galaxy Smartphone:

Code: Select all

Android.Version 14
Android-Security Patchlevel 1.1.2025
One UI-Version 6.1

Code: Select all

Total Commander Android 3.60b4

Code: Select all

LAN-Plugin 3.57

Code: Select all

LAN Plugin Server Settings
Servername/Folder: <IP>/RpiShare
User: pi
Password: <password>
yes: SMB2
yes: SMB3
no: to the other three options
LAN Plugin connections protected with master password (with fingerprint option).
I have to allow to switch of connection restrictions for the connection at first connect.
sheepdoggie
Junior Member
Junior Member
Posts: 8
Joined: 2025-02-02, 02:44 UTC

Re: Android to Raspberry Pi

Post by *sheepdoggie »

testparm output on raspberry pi:

Code: Select all

# Global parameters
[global]
	log file = /var/log/samba/log.%m
	logging = file
	map to guest = Bad User
	max log size = 1000
	obey pam restrictions = Yes
	pam password change = Yes
	panic action = /usr/share/samba/panic-action %d
	passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
	passwd program = /usr/bin/passwd %u
	server role = standalone server
	unix password sync = Yes
	usershare allow guests = Yes
	idmap config * : backend = tdb


[homes]
	browseable = No
	comment = Home Directories
	create mask = 0700
	directory mask = 0700
	valid users = %S


[printers]
	browseable = No
	comment = All Printers
	create mask = 0700
	path = /var/spool/samba
	printable = Yes


[print$]
	comment = Printer Drivers
	path = /var/lib/samba/printers


[Media]
	path = /media/pi/FLASH1/media
	read only = No
	valid users = pi
Post Reply