
我正在使用OpenSSH
for Windows 7.7p1
。除了一些其他指令之外,Windows 1903
我使用Match User xxxx
in sshd_config
file, inProgram Data -> SSH
將 xxxx 的根目錄更改為 中的另一個路徑。filesystem
此方法在早期版本中運作良好,我可以使用此使用者進行連線並進入變更後的根目錄。
在新的穩定版本中,該Match User
指令似乎沒有被遵守。
看看sshd
日誌,我看到了這個......
26948 2019-09-30 15:10:29.745 debug1: userauth-request for user TestLocalAccount service ssh-connection method none [preauth]
26948 2019-09-30 15:10:29.745 debug1: attempt 0 failures 0 [preauth]
26948 2019-09-30 15:10:29.745 debug3: mm_getpwnamallow entering [preauth]
26948 2019-09-30 15:10:29.745 debug3: mm_request_send entering: type 8 [preauth]
26948 2019-09-30 15:10:29.745 debug3: mm_getpwnamallow: waiting for MONITOR_ANS_PWNAM [preauth]
26948 2019-09-30 15:10:29.745 debug3: mm_request_receive_expect entering: type 9 [preauth]
26948 2019-09-30 15:10:29.745 debug3: mm_request_receive entering [preauth]
26948 2019-09-30 15:10:29.745 debug3: mm_request_receive entering
26948 2019-09-30 15:10:29.745 debug3: monitor_read: checking request 8
26948 2019-09-30 15:10:29.745 debug3: mm_answer_pwnamallow
26948 2019-09-30 15:10:29.745 debug2: parse_server_config: config reprocess config len 297
26948 2019-09-30 15:10:29.745 debug3: checking match for 'User TestLocalAccount' user testlocalaccount host 127.0.0.1 addr 127.0.0.1 laddr 127.0.0.1 lport 22
26948 2019-09-30 15:10:29.745 debug3: match not found
26948 2019-09-30 15:10:29.745 debug3: mm_answer_pwnamallow: sending MONITOR_ANS_PWNAM: 1
26948 2019-09-30 15:10:29.745 debug3: mm_request_send entering: type 9
這些日誌 -
26948 2019-09-30 15:10:29.745 debug2: parse_server_config: config reprocess config len 297
26948 2019-09-30 15:10:29.745 debug3: checking match for 'User TestLocalAccount' user testlocalaccount host 127.0.0.1 addr 127.0.0.1 laddr 127.0.0.1 lport 22
26948 2019-09-30 15:10:29.745 debug3: match not found
- 當 中沒有
Match User
指令時不會出現sshd_config
。至少這一點以及它考慮設定檔更改的事實似乎表明這是正確的檔案(Prog Files -> OpenSSH 有另一個 sshd_config_default)。
sshd_config 中的相關部分如下所示 -
# override default of no subsystems
Subsystem sftp sftp-server.exe
Match User TestLocalAccount
ChrootDirectory C:\Users\TestLocalAccount\Downloads
PubKeyAuthentication yes
本節中的任何指示均未Match user
遵守。開啟會話只會TestLocalAccount
開啟該會話的家庭使用者設定檔。我正在嘗試使用SecureFX
SFTP 用戶端。