Disconnect an SFTP client safely
Finish every queued SFTP transfer, wait for the final close response, disconnect the session, and remove or revoke the saved API key safely.
Last reviewed
A transfer is not safely finished when its progress meter first reaches 100%. Dosya buffers SFTP uploads until the client closes the file handle; only a successful CLOSE response confirms that the cloud upload committed. Closing the connection earlier can leave no remote file, while an interrupted download can leave an incomplete local copy.

Before disconnecting, identify whether the queue contains uploads, downloads, or only completed entries. An upload can still fail at CLOSE because workspace access changed, storage or policy rejected the file, or the service returned an API error. A download is complete only when the local client has written the expected byte count.
Steps
- Stop adding new work to the SFTP queue, then wait until every required transfer leaves its active or retrying state. Keep any failure message that names
close,read,write, status 2, status 3, or status 4. - For an upload, refresh or relist the destination and compare the remote name and size with the local source. For a download, compare the local size or calculate a local checksum against a known-good copy.
- Close open remote editors and file handles before ending the session. In an OpenSSH prompt use
bye; in a graphical client choose its normal disconnect command instead of terminating the process. - Confirm the client shows no queued transfer and no live Dosya session. If it still reconnects automatically, disable that saved site’s background synchronization or remove the site from the client’s startup list.
- Remove the saved
dos_…password from that client’s private credential store when this computer should no longer connect. Deleting a saved password does not invalidate copies of the same API key stored elsewhere. - For access that must end, open Profile → API keys, select the dedicated key, and choose Revoke. The receipt is Key revoked; SFTP caches successful logins for up to 60 seconds, while API authorization has separate caches. After invalidation settles, reconnect and attempt a harmless operation to verify refusal; 60 seconds is not a total revocation bound.

Revoking the key prevents later operations but does not delete files already transferred. Ending a session also does not cancel a cloud mutation that already returned a successful CLOSE; verify the destination before deciding whether cleanup is needed.
If the queue is stuck, preserve the operation name and bounded server message. Dosya maps API 403 to Permission denied, API 404 to No such file, and other failures to status 4; key-shaped text is redacted and messages are capped at 180 characters.
Expected result
The client has no active file handle or queued transfer, required files have verified final bytes, and the session is closed. Any credential removed locally is absent from that device, while a revoked key is refused on a fresh connection or authenticated operation after cache invalidation settles.
Related guides
Was this helpful?
Loading helpfulness results…
Voting saves a necessary ballot cookie for up to 180 days so you can change your answer.
Questions and replies
Ask about the steps in this guide. Questions are reviewed before publication.
Keep account details, credentials and private files out of public questions. Use private support for those.
Loading questions…
Sign in to your Dosya account to ask a question.