
我需要授予對我的生產伺服器中的某些 X 先生的存取權限,以便他可以將檔案推送到我的伺服器。由於沒有必要給他 shell 存取權限,我決定使用受限 shell (rssh),這樣他只能將檔案複製到我的伺服器而無法存取它。該檔案將使用 RSYNC over SSH 進行傳輸。
用於傳輸檔案的命令是
rsync -ua -e 'ssh -p 55' /appdata/paths/ 192.168.4.172:/home/example/
但是使用受限 shell 透過 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