制限されたシェルでは SSH 経由の RYSNC が機能しない

制限されたシェルでは SSH 経由の RYSNC が機能しない

私の運用サーバーで、X 氏にアクセス権を与えて、ファイルを私のサーバーにプッシュできるようにする必要があります。彼にシェル アクセスを与える必要はないので、制限付きシェル (rssh) を使用することにしました。これにより、彼は私のサーバーにアクセスできず、ファイルをコピーすることしかできなくなります。ファイルは SSH 経由で RSYNC を使用して転送されます。

ファイルを転送するために使用されているコマンドは

rsync -ua  -e 'ssh -p 55'  /appdata/paths/ 192.168.4.172:/home/example/ 

しかし、制限されたシェルを使用したSSH経由のrsyncはうまく動作しないようです

$ rsync -ua /appdata/paths/ -e 'ssh -p 565'
[email protected]:/home/example/
#################################################################################################################

 This service is restricted to authorized users only. All activities on this system     
 are logged.            ##
  ##   Unauthorized access will be fully investigated and reported to the appropriate     
 law enforcement agencies.  ##
#
  insecure -e option not allowed.
 This account is restricted by rssh.
 Allowed commands: scp rsync

  If you believe this is in error, please contact your system administrator.

  rsync: connection unexpectedly closed (0 bytes received so far) [sender]
  rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]

では問題なく動作していますがscp、問題はrsync

答え1

rrsync(おそらくシステム上で gzip 形式で利用可能、例: )を使用して/usr/share/doc/rsync/scripts/、 authorized_keys ファイル内の行を rsync 用にそこにインストールされている公開キーに関連付ける必要があります。

command="$HOME/bin/rrsync -ro ~/rsyncdir/",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding

必要に応じて詳細をご覧くださいここそしてここ

関連情報