제한된 쉘에서는 SSH를 통한 RYSNC가 작동하지 않습니다.

제한된 쉘에서는 SSH를 통한 RYSNC가 작동하지 않습니다.

내 서버에 파일을 푸시할 수 있도록 내 프로덕션 서버에 있는 일부 Mr 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

필요한 경우 더 자세한 내용을 찾을 수 있습니다.여기그리고여기

관련 정보