FTP vs SFTP Root Folder Differences #268
Replies: 2 comments 3 replies
-
Hi, not sure I fully understand your issue - do you want to switch to SFTPGo and still use OpenSSH and vsftpd at the same time? If you want to use SFTPGo only you can just set a home directory and it will be the same for both SFTP and FTP and then the directory listing will be the same. SFTPGo uses virtual permissions, unrelated to filesystem permissions, so you can have a read-only directory even if it's writable at the filesystem level. Virtual permissions can be set per-directory and not only globally at the account level You can also change the home dir dinamically using the pre-login hook. This could be racy for your use case with the current code. As for a PR for this function, if I understand the purpose correctly, I think it is not enough to simply hide a directory from the list, a user could write a full download / upload path so you should update all other methods as well and probably also the method of scanning the quotas. But I should look to the PR to understand better. Having this feature for all users doesn't even seem ideal. Please let me better understand, thank you |
Beta Was this translation helpful? Give feedback.
-
We want to use just SFTPGo in place of vsftpd and OpenSSH. OpenSSH will remain on the server for SSH access to maintain the server, but SFTP connections will go to SFTPGo. I have created a gist Dockerfile to demonstrate how our current setup functions.
Typically this would be the ideal setup. However, unlike my gist example with two users, we have thousands of users with anywhere from a couple to a dozen integrations per user. If we migrate a user's files from Integration Examples
|
Beta Was this translation helpful? Give feedback.
-
We are in the process of migrating users from an existing setup using local storage with vsftpd, and OpenSSH for our client's FTP/SFTP accounts to sftpgo with S3. The user's home folders follow a pattern similar to
/home/[username]/files
, but then OpenSSH is configured to chroot users to/home/[username]
. The root user owns the/home/[username]
due to security rules, hence the need for the user-writablefiles
folder. A client who connects via FTP will see all their files under the/
root folder with these settings. On the other hand, when a client connects via SFTP, they must include the/files
folder to see the same list.We have been working on an update that would add a virtual
/files
prefix to all paths under ssh connections, which would apply to all users by adding aFolderPrefix
to thesftpd.Configuration
struct. The prefix is then removed in the process of resolving the incoming requested file path on the vfs.For example: sftpd/handler.go
Is there another way we can solve the root folder difference between protocols? Would a PR for this feature need to be user-level configurable before it was acceptable?
Beta Was this translation helpful? Give feedback.
All reactions