TeamAmaze / TeamAmaze/AmazeFileManager

SFTP connection keeps closing on every operation

Open
#4,443 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Ssh/Scp/Sftp Issue-Bug Issue-Severe (high)
Dominant language
Kotlin
Stars
6.4k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
1

Description

Describe the bug

It appears SFTP connection closes and re-opens on every operation. Not only is this very inefficient, it also triggers key password prompt on every open.

To Reproduce
Steps to reproduce the behavior:

  1. Create a SFTP connection that uses a private key with a passphrase
  2. Open connection
  3. Enter key password
  4. Open a folder inside
  5. You will be asked for a password again

Expected behavior
SFTP session should remain open throughout the app session

Smartphone (please complete the following information):

  • Device: Pixel 9 Pro Fold
  • OS: Android 16
  • Rooted: Yes
  • Version: 622d0f8b5fc75acb828e68dedb98c776ac9ca53c

Additional context

Force setting closeClientOnFinish here to false appears to fix the issue, but I'm not sure what the implication is - there probably was a reason that this is set to true by default

Contributor guide

Open the contributing guide

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

Start in app/src/main/java/com/amaze/filemanager/filesystem/ssh/SshClientTemplate.kt at the closeClientOnFinish setting. Reproduce the passphrase prompt by opening an SFTP connection and then opening a folder, and inspect why the client is closed between operations. Done means the SFTP session remains open for the app session without repeatedly requesting the key password, while preserving the intended connection cleanup.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.