Live data from Hacker News

SFTPGo: A Full Featured SFTP Server in Go

github.com

11–20 of 59 posts

Re: SFTPGo: A Full Featured SFTP Server in Go

#11
post #6

Earlier quoted context omitted.

OpenSSH is very much tied to system users, but sometimes you might want to give access to external users that don’t need to exist as actual unix users. because SSH and SFTP are so closely tied together, a configuration via PAM is pretty hard and inconvenient because creating fake users via PAM for SFTP will also create them for SSH and because there’s no easy way to map all such virtual users to the same user-id. Als…

I'd second this, I've longed struggled to come up with a easy-to-deploy sshd/sftp/chroot configuration that permitted easy database-driven configuration w/o extra shell access. You have to fight a lot of defaults to get this just right. Would the OpenSSH upstream accept patches for an unprivileged sshd/sftp-subsystem to make this easier to use their battle tested code?

Proftpd can do sftp-only out of the box.

Re: SFTPGo: A Full Featured SFTP Server in Go

#13
post #6

Part of the utility of SFTP to clients and admins is the fact there are no additional requirements other than SSHD to function. This seems to fly in the face of that. If you are willing to install more software, why not use a more feature filled file server?

OpenSSH is very much tied to system users, but sometimes you might want to give access to external users that don’t need to exist as actual unix users. because SSH and SFTP are so closely tied together, a configuration via PAM is pretty hard and inconvenient because creating fake users via PAM for SFTP will also create them for SSH and because there’s no easy way to map all such virtual users to the same user-id. Als…

Thanks for the explanation! The OP's question was the first one that popped into my mind too...

Re: SFTPGo: A Full Featured SFTP Server in Go

#14
post #6

Earlier quoted context omitted.

OpenSSH is very much tied to system users, but sometimes you might want to give access to external users that don’t need to exist as actual unix users. because SSH and SFTP are so closely tied together, a configuration via PAM is pretty hard and inconvenient because creating fake users via PAM for SFTP will also create them for SSH and because there’s no easy way to map all such virtual users to the same user-id. Als…

I'd second this, I've longed struggled to come up with a easy-to-deploy sshd/sftp/chroot configuration that permitted easy database-driven configuration w/o extra shell access. You have to fight a lot of defaults to get this just right. Would the OpenSSH upstream accept patches for an unprivileged sshd/sftp-subsystem to make this easier to use their battle tested code?

If you just want to share files and not giving the option to upload files, you could try graft...

https://github.com/sandreas/graft

graft serve ./*.txt

will serve every txt file in the current dir...

Re: SFTPGo: A Full Featured SFTP Server in Go

#15
This looks like a very interesting project to make a lightweight sftp server, though the dependency on an SQL db makes it a bit harder to install.

Go has a really good set of crypto primitives, an excellent ssh implementation maintained by the core team, and a great sftp server and client library which makes this project possible.

I recently added an sftp server to rclone: https://rclone.org/commands/rclone_serve_sftp/ - this can serve any of the cloud providers rclone support as sftp (or local disk). This runs on windows/macOS/linux too.

It was a joy to add this as the Go libraries are very well thought out and easy to use.

Re: SFTPGo: A Full Featured SFTP Server in Go

#16

Part of the utility of SFTP to clients and admins is the fact there are no additional requirements other than SSHD to function. This seems to fly in the face of that. If you are willing to install more software, why not use a more feature filled file server?

With this solution you can easily create fake account just for sftp, and the installation is very simple. In other words, it solves the biggest security problem with sftp accounts - what you usually want is only to give people access to a few files, and not to give them full system accounts.

Re: SFTPGo: A Full Featured SFTP Server in Go

#17
post #15

This looks like a very interesting project to make a lightweight sftp server, though the dependency on an SQL db makes it a bit harder to install. Go has a really good set of crypto primitives, an excellent ssh implementation maintained by the core team, and a great sftp server and client library which makes this project possible. I recently added an sftp server to rclone: https://rclone.org/commands/rclone_serve_sft…

Not sure the case in this context, but usually the SQLite dependency can almost be seen as no-dependency at all - it's just a file on the disk without any external dependency.

Re: SFTPGo: A Full Featured SFTP Server in Go

#18
post #15

This looks like a very interesting project to make a lightweight sftp server, though the dependency on an SQL db makes it a bit harder to install. Go has a really good set of crypto primitives, an excellent ssh implementation maintained by the core team, and a great sftp server and client library which makes this project possible. I recently added an sftp server to rclone: https://rclone.org/commands/rclone_serve_sft…

Not sure the case in this context, but usually the SQLite dependency can almost be seen as no-dependency at all - it's just a file on the disk without any external dependency.

On the other hand it requires a C compiler, so it's definitely heavier than a pure go application

Re: SFTPGo: A Full Featured SFTP Server in Go

#19

Part of the utility of SFTP to clients and admins is the fact there are no additional requirements other than SSHD to function. This seems to fly in the face of that. If you are willing to install more software, why not use a more feature filled file server?

I actually had to implement something very similar. The use case was an SFTP upload interface for clients that they would use the same login credentials they use for the web portal to upload to unique subfolders in Azure Storage.

Re: SFTPGo: A Full Featured SFTP Server in Go

#20
post #18

Earlier quoted context omitted.

Not sure the case in this context, but usually the SQLite dependency can almost be seen as no-dependency at all - it's just a file on the disk without any external dependency.

On the other hand it requires a C compiler, so it's definitely heavier than a pure go application

Serious question, why hasn't anyone rewritten it in Go? Been awhile since I've looked at it but C to Go doesn't seem that difficult to translate.

Edit: just looked at the amalgamation again, it's huge... Still surprised no one has tried it yet that I know of. Pre-processor directives would probably make it even more difficult though.

Edit2: and it already works so what's the point, other than an extremely challenging problem

Post reply on HN