I created a username with the bash shell — a normal shell with all commands available — but I intend to use this shell for a backup service, which should allow only the rsync command. Therefore, I am trying to restrict this shell to execute rsync commands only. How can I do this with .bash_profile and .bashrc?
Additional Information: This shell is used to back up files and folders only. I connect another shell to rsync using an ssh key.
You can’t – not using just those files. Why not give them another shell, with fewer options?
rssh is designed for just this purpose.
Advantages of rssh over authorized_keys restrictions (not all may apply to you or be interesting):