|
|
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已! |
|
恭喜您是本站第 1730377
位訪客!
登入 | 註冊
|
|
|
|
發表者 |
討論內容 |
冷日 (冷日) |
發表時間:2012/6/21 10:18 |
- Webmaster

- 註冊日: 2008/2/19
- 來自:
- 發表數: 15773
|
- [分享]SSH(SFTP) Chroot Version
- 補充一下,如果上述的 ssh chroot 碰到類似如下的問題:
Starting sshd:/etc/ssh/sshd_config: line 119: Bad configuration option: xSubsystem
/etc/ssh/sshd_config: line 122: Bad configuration option: Match
/etc/ssh/sshd_config: line 123: Bad configuration option: ChrootDirectory
/etc/ssh/sshd_config: line 124: Bad configuration option: XllForwarding
/etc/ssh/sshd_config: line 126: Bad configuration option: ForceCommand
/etc/ssh/sshd_config: terminating, 5 bad configuration options
[FAILED]
[root@hkhkgls1089 ssh]#
或是:
Starting sshd:/etc/ssh/sshd_config: line 123: Bad configuration option: Match
/etc/ssh/sshd_config: line 124: Bad configuration option: ChrootDirectory
/etc/ssh/sshd_config: line 125: Bad configuration option: XllForwarding
/etc/ssh/sshd_config: line 127: Bad configuration option: ForceCommand
/etc/ssh/sshd_config: terminating, 4 bad configuration options
[FAILED]
那應該是 ssh 的版本過舊導致 目前得知訊息,ChrootDirectory 好像是要 4 之後才支援(目前確認 openssh 4.3p2 可行) 檢查方法如下:
所以,如果是 CentOS4 的話,就是只有更新 ssh 一途可行。 偏偏 yum 更新現在又不支援 CentOS4 了,所以只能自己想辦法囉。 註:或是更新到 CentOS5 以上應該就 OK 囉!
另外有一個重點必須說一下,以免大家和冷日一樣在這問題上花費多餘的時間: 設定 Chroot 目錄權限:錯誤的目錄權限設定會導致在 log 中出現 "fatal: bad ownership or modes for chroot directory XXXXXX" 的訊息。 根據 openssh 5.1 chrootdirectory permissions issue 這篇文章的資訊顯示,目錄的權限設定有兩個要點: 由 ChrootDirectory 指定的目錄開始一直往上到系統根目錄為止的目錄擁有者都只能是 root 由 ChrootDirectory 指定的目錄開始一直往上到系統根目錄為止都不可以具有群組寫入權限
|
|
|
討論串
|