我使用PowerShell脚本安装了Cygwin。
我手动执行以下步骤:
运行新的cygwin bash shell(编辑cygwin.bat
后)并输入:
mount --change-cygdrive-prefix /
chmod +r /etc/passwd /etc/group
chmod 755 /var
启动Cygwin bash shell并运行ssh-host-config
。对所有关键代问题回答“是”。
是否可以在PowerShell脚本中自动执行这些操作,例如安装Cygwin,然后一次执行第1步和第2步?
答案 0 :(得分:3)
使用此命令:
bash.exe ssh-host-config --yes -u "Cygwinuser" -c "binmode ntsec tty" -w "pwd@123"
cygrunsrv -S sshd
稍后转到services.msc以检查服务是否正在运行