Someone has asked me how I restrict an SSH public key to only allow to SCP to a predefined directory
Here is the script I use for that : https://gist.github.com/Zoddo/035784d640ecf9156fa471534deb1e1f
For example, I use it on the server that stores backups of some of my VMs (so, they don't have a full SSH access to that server)
@DaD rssh can restrict to scp (for example) but can't restrict to a predefined directory.
@zoddo you can place the user in a chroot jail, that's how I use it
https://manpages.debian.org/stretch/rssh/rssh.conf.5.en.html
@DaD Yes, but that's more complex (and more secure as well)
@zoddo I use rssh
http://www.pizzashack.org/rssh/