I am wondering if there is a way that can help me not only install cygwin automatically but also help me establish OpenSSH server by using cygwin. Is it possible to do it in one script?
I am pretty sure it will require at least two scripts.
A silent install of cygwin is sort of possible, but tedious. It requires you going through the installation process at least partly manually once. Near the end of that link is a section "- If you want to configure something automatically after running setup.exe,", which you will have to adapt to complete the post-install setup required for running an ssh server in cygwin.