You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: SFTP file operations do not use the requested SSH user #1755
I have searched existing issues to confirm this is not a duplicate
I am running the latest version of Devsy
What happened?
Devsy’s SSH server provides an SFTP subsystem, but the SFTP handler uses the SSH session username only to select the starting home directory. Unlike SSH command execution, it does not switch the SFTP server process to that user. Consequently, SFTP file operations run with the Devsy agent process’s OS permissions rather than the requested user’s permissions. For example, connecting as vscode@<workspace>.devsy does not make SFTP operations run as vscode, but root.
This means, trying to connect a remote container, an agent may upload a file via SFTP and proceed to lock itself due to not owning it.
What did you expect to happen instead?
SFTP file operations should run with the OS identity associated with the requested SSH username (for example, vscode), or Devsy should clearly document the limitation and provide a supported way to select the effective SFTP user. They should not unexpectedly inherit the agent process identity.
Steps to reproduce
Start a Devsy workspace with an OS user such as vscode.
Connect to the workspace’s SSH server using SFTP with that username (for example, sftp vscode@<workspace>.devsy).
Try to list, read, or write files whose permissions differ between vscode and the user running the Devsy agent.
Observe that SFTP access follows the agent process’s permissions rather than the requested session user’s permissions.
devcontainer.json
Error output / logs
How often does this happen?
Every time
Operating system
Linux
Linux distribution (if applicable)
No response
Architecture
AMD64
Desktop app or CLI?
Both
Devsy version
v1.26.0
Devsy provider
Docker
Provider version
No response
Screenshots
No response
Anything else?
The SFTP handler is implemented in pkg/ssh/server/sftp_handler.go. It reads sess.User() to determine the home directory, but does not apply the user-identity switching performed by SSH command execution. This may lead to surprising permission behavior when the agent runs as root or as another account.
Activity
skevetter commentedon Nov 5, 2026
completed in linked PR