zhanghai / zhanghai/MaterialFiles

Unable to Connect to my SFTP Server with Public Key

Open
#921 11 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
9k
Forks
736
PR merge metrics
No merged PRs in 30d

Description

Usecase

  • phone A: a phone at home
    • running sshd with Termux.
  • phone B: my daily phone.
    • Connected to the Internet over 5G network, or any other Wi-Fi that isn't the same network as the home one
    • trying to connect to my phone A over material files.

Key setup and test over Termux

  1. On phone B, I created rsa key with Termux, and performed ssh-copy-id.
    • command used:
ssh-keygen -t rsa -b 2048 -f id_rsa
ssh-copy-id -i id_rsa.pub $username@$remote_ip_address -p $forwarded_port
  1. After this, when I do ssh -p $forwarded_port $username@$remote_ip_address, it askes my key's passphrase, and ssh session starts as soon as I type it.

Material Files situation

Ahead of getting in, some names may be injust as it is shown in my home language, but not in English.

Please guess by context.

  • Adding remote storage by:
    • Navigation Drawer
      • -> 'Add Storage...' which is with + icon
      • -> 'SFTP Server'
  • Contents of each input fields:
Name Value
Host Name same as $remote_ip_address
Port same as $forwarded_port
Path (empty)
Name test
Authentication Public Key
User Name same as $username
Private Key id_rsa that I used for Termux testing
Private Key Password my key's passphrase

Error

java8.nio.file.AccessDeniedException: /:net.schmizz.sshj.sftp.SFTPException: Permission denied

Others

Even with password authentication, it fails.
Of course,

~ $ cat ../usr/etc/ssh/sshd_config | grep "Password"
PasswordAuthentication yes

For short-term use, Termux sftp is just fine. But for long, CLI isn't the nicest solution I believe.
I want to use Material Files's beutiful GUI as my solution.

Would you help me to figure out this situation?
Thanks.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names Material Files' SFTP Server setup and a successful Termux SSH test, but no source files, tests, or specific code change. Start by comparing those connection details and the reported permission error; done would require a reproducible diagnosis and a defined app change, neither of which the issue currently specifies.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile-dev, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.