
如何保留 chroot SSH(而非 SFTP)使用者的活動歷史記錄?我試過了:
- 使用適當的權限在他們的家中創建了一個 .sh_history
- 在 .profile 及其被監禁的 /etc/profile 中建立了自訂 $HISTFILE
- 登入後匯出 HISTFILE。
這就是我在 sshd_config 中的匹配方式:
Match Group sshuser
ChrootDirectory %h
AllowTcpForwarding no
附加資訊:這是在 AIX 伺服器中,使用者的預設 shell 是 ksh。但如果解決方案需要的話,我可以毫無問題地將其切換到 bash。在 chroot 登入期間,不會執行「chrooted」/etc/profile 和使用者的 ~/.profile。不用說,被監禁的家庭對用戶是寫保護的,但是我提到的文件和歷史記錄所需的其他文件對用戶有足夠的權限