Fix SFTP access to a restricted folder

Diagnose an SFTP path restriction, distinguish workspace pins from unsupported folder anchors, and restore access without widening the key again.

Last reviewed

SFTP does not implement Dosya folder-anchored credentials. A key pinned to one folder is deliberately refused at authentication because this gateway cannot enforce that folder boundary. SFTP can honor a workspace pin, current workspace membership, the role’s access_sftp decision, and the role’s ordinary file permissions.

Four-step workflow for inspecting key restrictions, identifying an incompatible folder anchor, creating a workspace-pinned SFTP key, and testing its intended path.
Four-step workflow for inspecting key restrictions, identifying an incompatible folder anchor, creating a workspace-pinned SFTP key, and testing its intended path. Open full-size screenshot.

This distinction prevents a dangerous workaround: removing every restriction to make a login pass would expose more workspaces than the task needs. Replace only the incompatible part of the credential and keep SFTP protocol selection, expiry, active hours, scope, and workspace reach as narrow as possible.

Steps

  1. Open Profile → API keys, find the credential used by the failing client, and expand its configuration. Record its Permission, Protocols, Reach, expiry, active hours, and key prefix without exposing the secret.
  2. If Reach names a folder, stop retrying that key over SFTP. The creation form states that a folder-limited key works on WebDAV or the S3 gateway; SFTP rejects it rather than silently ignoring the anchor.
  3. Create a replacement key for the same client. Include SFTP, pin it to the required Workspace, leave Folder unset, and leave Allowed IP ranges empty because the gateway cannot forward the original client address.
  4. Choose Read only for list/download work or Full access for writes, then save the one-time secret. Confirm that the user’s role in that workspace allows SFTP and the intended file action.
  5. Replace the password in the client while keeping sftp.dosya.dev, port 2222, and the exact account email. Connect at /, where the server lists permitted workspace roots rather than a folder anchor.
  6. Enter the pinned workspace and list the target folder. Test one known read or a disposable non-empty write; after success, revoke the incompatible old key so it cannot be reused through WebDAV or S3.
Dosya SFTP overview with Get API Key and port 2222 connection stages used after replacing an incompatible credential.
Dosya SFTP overview with Get API Key and port 2222 connection stages used after replacing an incompatible credential. Open full-size screenshot.

Permission denied on a workspace path means the role or key cannot use that workspace. No such file or directory means the visible tree does not contain the supplied segment; workspace names and slugs are case-sensitive path components. A folder moved or renamed elsewhere can make an old client bookmark invalid even though the key is correct.

A successful replacement narrows access to the chosen workspace, not one subfolder. If a hard per-folder boundary is required, use WebDAV with the folder anchor instead of claiming SFTP can provide it.

Expected result

The replacement key authenticates over SFTP, / exposes only the permitted workspace set, and the intended path works under that workspace. No unsupported folder anchor or IP allowlist remains on the SFTP credential.

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.

    Check the outcome before you retry

    Use these shared checks when a task needs a second look.