Skip to content

Restricted ssh commands compatibility (rrsync) #76

@Jip-Hop

Description

@Jip-Hop

I have restricted the commands SSH users can run to only rrsync 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:

if ! dir_exists "${1}"; then
logerr "Source directory does not exist: ${1}"
logerr "See -h for help."
exit 1
fi

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions