windows设置sshd的shell

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force

设置完需要重启一下sshd

如果想用ssh-copyid, 需要把 c:/programData/ssh/sshd_config 最下面两行注释掉


#Match Group administrators
#       AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys

如果需要使用ssh-agent 连接到win server的sshd,暂不支持

如果需要使用ssh-agent 连接到win server的sshd, 需要使用较新版本的win openssh ,时间点参照下面这个isuee

https://github.com/PowerShell/Win32-OpenSSH/issues/1865

除此之外 ,不要忘记本来就应该的打开转发

AllowAgentForwarding yes

AllowTcpForwarding yes

posted @ 2024-04-07 14:19  马肯尼煤牙巴骨  阅读(10)  评论(0编辑  收藏  举报