cytopia / cytopia/linux-timemachine
Restricted ssh commands compatibility (rrsync)
- Dominant language
- Shell
- Stars
- 841
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Description
I have restricted the commands SSH users can run to only [`rrsync`](https://download.samba.org/pub/rsync/rrsync.1) using the `command` options in the SSH `authorized_keys` file. With `rrsync` I can allow access to only a certain directory (and optionally provide read-only access) and block shell access.
With this setup linux-timemachine fails:
```
timemachine user@server:/rsynctest ~/rsynctest/ -- --verbose
/usr/bin/rrsync: SSH_ORIGINAL_COMMAND='test -d /rsynctest' is not rsync
```
I have commented out these lines:
https://github.com/cytopia/linux-timemachine/blob/2fe23f3402404edaa947a27811a72b0d97fcfb3a/timemachine#L371-L375
Now the backup seems to complete successfully.
Would it be possible to not use `test -d` in this case? Perhaps the `rsync` command itself could be used to check if the source directory exists? Else if skipping this test doesn't cause issues, perhaps a new cli flag could be added?
Contributor guide
Assessment
This issue has not been assessed yet.