1

We want to send files around between some linux hosts via OpenSSH, but we don't want clients to be able to list / retrieve / modify existing files on the server.

In other words, it should be an "upload only" service working over the ssh protocol. Of course this means there will always be a way for the client to know if there is already a file with a given name on the server, that's ok as far as the file contents cannot be retrieved.

How could we achieve this, possibly using already established softwares available in common distributions?

1 Answer 1

1

Our current, partial, solution leverages rsync --ignore-existing and forces its commandline on the server side with a (non writable) ~/.ssh/authorized_keys like this:

command="rsync --server -e.Ls --ignore-existing . ." ssh-ed25519 ABCDEDFGfoobarbaz user@host
  • more than enough to prevent casual users from downloading remote files
  • can modify remote file if the client uses rsync -r --ignore-existing <single_file> user@server: instead of rsync -r --ignore-existing <whole_directory> user@server:
  • not 100% sure if there are other flaws or ways to circumvent intended usage
  • added bonus: rsync is everywhere and has handy --bwlimit option

So we're only halfway there and this is not an actual, complete solution.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .