使用 ForceCommand 腳本製作會話記錄會破壞 SCP

使用 ForceCommand 腳本製作會話記錄會破壞 SCP

我有以下行來sshd_config製作每次會議的記錄:

ForceCommand script -q "/transcripts/test_transcript" -c "{SSH_ORIGINAL_COMMAND:=bash}"

SSH 按預期工作,但當我嘗試 SCP 時,它此時掛起:

$ scp -v user@localhost:~/test .

# Lots of debug lines describing key exchange and auth

debug1: Sending command: scp -v -f ~/test

ForceCommand如果我刪除from 的行sshd_config,SCP 工作正常。

我認為這並不是製作會話記錄的常見模式,並嘗試尋找此問題的解決方案。正如您可以想像的那樣,很難找到提到的鏈接腳本,效用製作終端會話的打字稿實用程式Linux包,而不是其他腳本。

相關內容