wa2c / cifs-documents-provider

CIFS Documents Provider
MIT License
294 stars 26 forks source link

SFTP issue #83

Open paoloap opened 3 months ago

paoloap commented 3 months ago

Describe the bug I have an SSH shared folder on my home server and I can access to it through a password-less account (but with an RSA key). On my smartphone (Pixel 8a with GrapheneOS) I regularly installed and configured the app from F-Droid to be able to browse the folder with the default "Files" application. The configuration looks OK, in fact if I tap on the "Folder" button from app's configuration I can regularly see the 4 sub-directories into the shared folder. But into "Files" application, entering into my file server's folder, I see all the folders named like one of them, and I can't navigate into.

To Reproduce Steps to reproduce the behavior:

  1. Install the app
  2. Add connection named "Fileserver", type SSHFTP (Apache Commons), insert IP, port, username, leave blank password input, attach the SSH key, select the folder on remote server (on which the user has rwx rights)
  3. Save
  4. Click on the folder icon in the folder section to verify I can actully see the subfolders with the credentials (OK)
  5. Go into AOSP "Files" app
  6. Select "CIFS Documents Provider" from left menu
  7. Tap on "Fileserver" button
  8. Result like in the screenshot appended

Screenshots

93aa3bd560cd4676af1cf89f2bbbf13f

CIFS Documents Provider

App installed device (please complete the following information):

RebelliousX commented 3 months ago

There is a another issue related to RSA keys that might or might not be related. But to pinpoint the issue if it is related to RSA or not, can you test ed25519 keys instead if possible? I use ed25519 keys with passphrases too and have no issues. Also, try to download the APK from this repo directly, not sure if F-Droid is up-to-date with current version.

paoloap commented 2 months ago

Sorry if I answer only now, I was on vacations and had github logged out! I just tested after having generated a new ed25519 key pair. Unfortunately... no luck. Now I want to check if by some case I set wrong files/folders permissions/ownership (but I think everything is ok on that side too...)

RebelliousX commented 1 month ago

Sorry for the late reply, I really can't replicate the issue. I am guessing it is a permission issue.

I don't know your server configurations or type of NAS you are using. But, this is just a guess, I use TrueNAS. And despite I set a Home Directory for example, /mnt/MyDataPool/UsersDataset/MyUsername as a home directory for the user logging in SFTP session, Cifs Document Provider defaults to the root directory / instead which displays all directories and system files for the Linux file system. I believe the correct behavior is to use the home directory of the current user as the starting directory, since all file managers that support SFTP (SSH) do that. And when I run Midnight Commander file manager mc command from terminal when doing SSH session, it defaults to the home directory and not the root directory.

It is possible you don't have permission to view system files or read them for the user you are using. Or possibly change the character encoding from default UTF-8 to something else in CIFS connection setting and try again?