1 官方教程:
This is the home of the Cygwin project
Cygwin is :
- a large collection of GNU and Open Source tools which provide functionality similar to a Linux distributionon Windows.
- a DLL (cygwin1.dll) which provides substantial POSIX API functionality.
Cygwin is not:
- a way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows.
- a way to magically make native Windows apps aware of UNIX® functionality like signals, ptys, etc. Again, you need to build your apps from source if you want to take advantage of Cygwin functionality.
The Cygwin DLL currently works with all recent, commercially released x86 32 bit and 64 bit versions of Windows, starting with Windows XP SP3.
For more information see the FAQ.
Current Cygwin DLL version
The most recent version of the Cygwin DLL is 2.3.0. Install it by running setup-x86.exe (32-bit installation) orsetup-x86_64.exe (64-bit installation).
Use the setup program to perform a fresh install or to update an existing installation.
Note that individual packages in the distribution are updated separately from the DLL so the Cygwin DLL version is not useful as a general Cygwin release number.
Commercial Support for Cygwin
For Cygwin licensing or commercial support, please visit the Red Hat Cygwin Product site.
Community Support for Cygwin
For all non-commercial Cygwin-related questions and observations, please check the resources available at this site, such as the FAQ, the User‘s Guide and the mailing list archives. If you‘ve exhausted these resources then please send email to an appropriate mailing list . This includes observations about web pages, setup questions, questions about where to find things, questions about why things are done a certain way, questions about the color preferences of Cygwin developers, questions about the meaning of the number 42, etc.
Please send notification of technical problems (bad html, broken links) concerning these web pages to the Cygwin mailing list.
Please do not send personal email with "quick questions" to individual Cygwin contributors. The Cygwin mailing lists are the places for all questions. Really. I mean it.
1
1
https://cygwin.com/install.html
Installing and Updating Cygwin Packages
Installing and Updating Cygwin for 32-bit versions of Windows
Run setup-x86.exe any time you want to update or install a Cygwin package for 32-bit windows. The signature forsetup-x86.exe can be used to verify the validity of this binary using this public key.
Installing and Updating Cygwin for 64-bit versions of Windows
Run setup-x86_64.exe any time you want to update or install a Cygwin package for 64-bit windows. The signature forsetup-x86_64.exe can be used to verify the validity of this binary using this public key.
General installation notes
When installing packages for the first time, setup*.exe does not install every package. Only the minimal base packages from the Cygwin distribution are installed by default, which takes up about 100 MB.
Clicking on categories and packages in the setup*.exe package installation screen allows you to select what is installed or updated.
Individual packages like bash, gcc, less, etc. are released independently of the Cygwin DLL, so the Cygwin DLL version is not useful as a general Cygwin release number. The setup*.exe utility tracks the versions of all installed components and provides the mechanism for installing or updating everything available from this site for Cygwin.
Once you‘ve installed your desired subset of the Cygwin distribution, setup*.exe will remember what you selected so rerunning the program will update your system with any new package releases.
On Windows Vista and later, setup*.exe will check by default if it runs with administrative privileges and, if not, will try to elevate the process. If you want to avoid this behaviour and install under an unprivileged account just for your own usage, run setup*.exe with the --no-admin option.
The setup*.exe installer is designed to be easy for new users to understand while remaining flexible for the experienced. The volunteer development team is constantly working on setup*.exe; before requesting a new feature, check the wishlist in the README.
Q: Is there a command-line installer?
A: Yes and no. The setup*.exe program understands command-line arguments which allow you to control its behavior and choose individual packages to install. While this provides some functionality similar to such tools as apt-get or yumit is not as full-featured as those packages.
The basic reason for not having a more full-featured package manager is that such a program would need full access to all of Cygwin‘s POSIX functionality. That is, however, difficult to provide in a Cygwin-free environment, such as exists on first installation. Additionally, Windows does not easily allow overwriting of in-use executables so installing a new version of the Cygwin DLL while a package manager is using the DLL is problematic.
Q: How do I install everything?
A: You do not want to do this! This will install an enormous amount of packages that you will never use, including debuginfo and source for every package.
Clicking on the "Default" label next to the "All" category to change it to "Install" will mark every Cygwin package for installation. Be advised that this will download and install tens of gigabytes to your computer.
1
使用 Cygwin 建立 SSH 通道:桌面 Unix 仿真程序
安装
在可以使用 Cygwin 建立通道之前,必须先正确安装它。
安装 Cygwin 最重要的注意事项是创建正确的 Unix 文件夹。Cygwin 的网站提供了完整详细的说明;下面是一个缩略版。
- 下载并安装 Cygwin。Cygnus 允许选择从 Web 安装,但从本地磁盘安装速度会更快(而且最终效率更高)。请务必下载文件并将其保存在容易找到的位置。
- 点击 Cygwin 的“setup.exe”图标并按照屏幕提示操作,接受默认选项。系统会询问您具体的文本格式,以及您希望 Cygwin 仅供您自己使用还是与其他用户共享。为便于使用,请将文本格式选择为 Unix,共享选项选择为“所有”。Cygwin 随后将安装,并在开始菜单和桌面上创建图标。如果没有创建图标,请再次运行安装程序。安装程序不会重新安装 Cygwin,而是把您带到安装过程的最后,在那里您可以选中指示安装图标的框。
- 创建 Unix 文件夹。可以按照 Cygwin 配置说明的建议,从 Cygwin 中创建标准目录(有关配置说明,请参见 http://www.cygwin.com),或者可以从 Windows 中设置它们。使用 Windows 方法有某些好处,尤其在您不是很熟悉 Unix 命令和协议时。由于 Cygwin 可以读取 Win32 (Windows) 和 Unix (POSIX) 文件路径,因此两种这方法都可以接受。可以在 http://www.itd.umich.edu/itcsdocs/s4148/s4148.pdf 中找到创建 Unix 目录的非常清楚的说明。虽然那些说明是针对程序的早期版本的,但它们仍适合:仍必须创建典型的 Unix 目录。
- 修改 cygwin.bat 文件。.bat 文件指定 bash 必须执行的命令及其顺序。其中“C”驱动器上的“Unix”目录包含传统的 Unix 目录,只要您不使用任何使 Unix 混淆的字符(例如,连字符、空格等),就可以将它命名为任何名称。使用记事本等文本编辑器配置 cygwin.bat 文件。不要使用 Microsoft Word 或任何带格式的程序。C:\Cygwin 目录和 C:\unix 目录包含重要的主目录。将 .bat 文件配置为:
@ECHO OFF SET MAKE_MODE=Unix SET CYGWIN=notty SET HOME=C:\unix\HOME\[your home directory name] SET TERM=VT100 CHDIR C:\Unix\HOME\[your home directory name] SET PATH=C:\Unix\BIN;C:\Unix\USR\LOCAL\BIN;C:\CYGWIN\BIN;%PATH% BASH
- 为使 Cygwin 更有效运行,可能需要在桌面上配置快捷方式图标,以便它在正确的目录中启动程序。如果您已经在 .bat 文件中指定了 HOME 目录,则没必要在桌面上配置快捷方式图标。
Cygwin 提供了一些更深入的限定,如果需要,您可以进一步限定配置。如果您对 Unix 命令和文件结构熟悉,您会发现这很容易;如果您不熟悉,Cygwin 也非常宽容,您很快就可以掌握。
建立通道
根据站点的配置方式,您可以使用本地生成的密钥或站点管理员设置的公共密钥,通过 SSH 通道访问 CVS。如果您对站点使用的方法不确定,请咨询站点管理员。
在本地生成密钥:
- 从 Cygwin 或其它 UNIX 类型的命令提示符键入:“ssh-keygen.exe -d”并按 Enter。您将看到:
-
- 正在生成 DSA 参数和密钥。
- 输入保存密钥的文件 (/home/Administrator/.ssh/id_dsa):[如果使用默认位置,请按 Enter 键]
- 输入密码(如果没有密码,则为空):[请保留为空并按 Enter]
- 再次输入相同的密码:[请保留为空并按 Enter]
- 您的标识已经保存在 /home/Administrator/.ssh/id_dsa 中。
- 公共密钥已经保存在 /home/Administrator/.ssh/id_dsa.pub 中。
- 从计算机复制“id_dsa.pub”。将新副本命名为“[用户名]_id_dsa.pub”(例如“jmorse_id_dsa.pub”),并将它附加到事件以获得技术支持。要想获得通过 CVS 通道的访问权限,需要在 CVS 服务器上安装密钥。关于加载 *_id_dsa.pub 密钥的位置,请咨询支持代表。
每次希望访问 CVS 存储库时,都需要运行 Cygwin 或其它 UNIX 外壳程序并使用以下命令登录:
ssh -x -2 -L 2401:localhost:2401 [email protected][project.domain]
其中 [project.domain] 相当于 CVS 服务器的名称。
您将收到一条信息,指出“未找到主机密钥,是否确实要继续”。键入“yes”。需要键入整个单词。您将收到另一行内容,且光标移到窗口的左侧,并闪烁。可以最小化窗口,但不要关闭它。关闭窗口将使通道中断。
如果您使用系统管理员生成的公共密钥访问通道,系统会提示您输入密码。请向站点管理员或项目所有者索要密码。
注意:如果您生成了自己的密钥但系统仍提示您输入密码,则您的密钥可能尚未正确添加到服务器。如果确实如此,请与技术支持代表联系。
只要该窗口保持运行,通道就会一直运行,但发生网络错误或其它连接问题时除外。要停止通道,请按 ctrl-break。
https://www.open.collab.net/scdocs/ddSSHGuideCygwin.html.zh-cn
1
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx