Help! Permission denied (13) with sftp gio mount of non-root Android file system

I have installed the SimpleSSH app on my t-mobile TVision HUB v2 and am able to use ssh, scp and sftp with it from my Linux mint x64 laptop without problems. The TVision has not been rooted. From the ssh terminal I see:

:/data/user/0/org.galexander.sshd/files $ uname -a
Linux localhost 5.4.86-ab1929 #1 SMP PREEMPT Wed Mar 16 11:26:08 CST 2022 armv8l
:/data/user/0/org.galexander.sshd/files $ 

I use gigolo to mount two other shares, one of them an smb share to another Linux system and the other an sftp connection to a Raspberry Pi running raspbian. Both of these shares work and I expected no problems with the share to the TVision. Unfortunately that is not the case.

Using gigolo to create the mount appear to work fine. I can list the share using gio mount -i -l:

Mount(0): tvision -> sftp://tvision:2222/
  Type: GDaemonMount
  themed icons:  [folder-remote]  [folder]  [folder-remote-symbolic]  [folder-symbolic]
  symbolic themed icons:  [folder-remote-symbolic]  [folder-symbolic]  [folder-remote]  [folder]

Unfortunately when I attempt to access the share I get the Permission denied (13) error. Running logcat on the TVision via ssh reveals the problem:

05-06 11:46:18.249 19813 19813 W libsftp-server.: type=1400 audit(0.0:24090): avc: denied { read } for name="/" dev="dm-6" ino=2 scontext=u:r:untrusted_app_29:s0:c86,c256,c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0 app=org.galexander.sshd

So for some reason there is an attempt to access the file system root, which cannot succeed as the TVision is not rooted. I have specified accessible locations in my mount request, so I am puzzled why the attempt to access the root.

How can I correct this problem? I want to be able to mount the Android file system and work with it using my usual tools as opposed to having to make use only of specific tools such as scp and sftp.


PS: I thought to try yet another gio command and got these results:

dhdurgee@z560:~/Downloads$ gio info "sftp://tvision:2222/"
display name: / on tvision
name: /
type: directory
size:  4096
uri: sftp://tvision:2222/
local path: /run/user/1000/gvfs/sftp:host=tvision,port=2222
unix mount: gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000
  standard::type: 2
  standard::name: /
  standard::display-name: / on tvision
  standard::icon: inode-directory, folder, inode-directory-symbolic, folder-symbolic
  standard::content-type: inode/directory
  standard::fast-content-type: inode/directory
  standard::size: 4096
  standard::symbolic-icon: inode-directory-symbolic, folder-symbolic, inode-directory, folder
  etag::value: 1230768000
  id::filesystem: sftp:host=tvision,port=2222
  access::can-read: TRUE
  access::can-execute: TRUE
  access::can-trash: FALSE
  time::modified: 1230768000
  time::access: 1230768000
  unix::mode: 16877
  unix::uid: 0
  unix::gid: 0

I am unsure how to interpret the differences between the mount output and the info output, but I do see a reference in the mount to the default location as the ssh home directory while the info output appears to reference the root.


I thought of another approach to try and entered the URI I was using with gio mount in the SeaMonkey browser. SeaMonkey was able to show me the directory and allow me to browse the tree and files in the tree. So both the command line sftp program and my browser can access the URI, only gio mount appears to be failing to access the URI as intended.

How can I proceed to get this operational with gio mount?



After a bit more research I changed my URI a bit and now I can use gio commands against the mount, but attempting to use the share in /run/user/1000/gvfs still yields permission errors!

Here is a sample output:

dhdurgee@z560:~/Downloads$ gio mount sftp://dhdurgee@tvision:2222//storage/emulated/0/
dhdurgee@z560:~/Downloads$ ls -l /run/user/1000/gvfs
total 8
drwxr-xr-x 1 dhdurgee dhdurgee 4096 Feb  4  2021 'sftp:host=rpi,user=pi'
drwxr-xr-x 1 dhdurgee dhdurgee 4096 Dec 31  2008 'sftp:host=tvision,port=2222,user=dhdurgee'
drwx------ 1 dhdurgee dhdurgee    0 May  6 10:50 'smb-share:server=dg41ty,share=testing'
dhdurgee@z560:~/Downloads$ gio list sftp://dhdurgee@tvision:2222//storage/emulated/0/
dhdurgee@z560:~/Downloads$ cd '/run/user/1000/gvfs/sftp:host=tvision,port=2222,user=dhdurgee'/
dhdurgee@z560:/run/user/1000/gvfs/sftp:host=tvision,port=2222,user=dhdurgee$ ls
ls: reading directory '.': Permission denied

How do I get this corrected?


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.