Cygwin 安装:
1:下载
http://www.cygwin.com/setup.exe
2:运行
我们看到有三种安装模式:
•Install from Internet,这种模式直接从Internet安装,适合网速较快的情况;
•Download Without Installing,这种模式只从网上下载Cygwin的组件包,但不安装;
•Install from Local Directory,这种模式与上面第二种模式对应,当你的Cygwin组件包已经下载到本地,则可以使用此模式从本地安装Cygwin。
这里需要说明一下的是,第一次全部安装选择第一种模式,但是后续我们开发过程中发现一些组件包没有安装的话,可以再次运行安装程序,
选择第二种模式,也就是单独下载组件包而不安装,这样可以分次下载需要的组件包。等全部组件包下载完毕后,在运行第三种模式从本地安装组件包。
需要特别注意的是,下载和安装的时候一定要记住使用的镜像站点,因为软件把组件包按照不同的镜像放置在不同的目录,如果几次下载的镜像不一样,那从本地安装的时候,是只能找到最新的一次的镜像下载的组件包的,这里需要注意。
安装过程中记得选择所需的包,这里需要的是,请参考下面的图示:
Net Category下的:openssh,openssl
BaseCategory下的:sed (若需要Eclipse,必须sed,,默认选择好的)
Devel Category下的:subversion(建议安装)
安装完成。
cygcheck -c cygwin :查看cygwin当前的版本
cygcheck -c :检查所有安装软件的版本号
uname -a 可以查看cygwin的版本和内核版本
lenovo@lenovo-PC ~
$ uname -a
CYGWIN_NT-6.1 lenovo-PC 1.7.20(0.266/5/3) 2013-06-07 11:11 i686 Cygwin
如果要查看某一个软件安装的版本,直接用cygcheck -c + 软件名称,如cygcheck -c gzip
cat /proc/version也可以获取需要的信息,上面两点有点类似Linux
lenovo@lenovo-PC ~
$ cat /proc/version
CYGWIN_NT-6.1 version 1.7.20(0.266/5/3) (corinna@calimero.vinschen.de) (gcc version 4.5.3 20110428 (Fedora Cygwin 4.5.3-4) (GCC) ) 2013-06-07 11:11
3:配置SSH
安装完成后,开始配置SSH
1.打开CygWin输入SSH-HOST-CONFIG
2.系统提示:should privilege separation be used ? 回答:no
3.系统提示:(say "no" if it is already installed as a service?回答:yes
4.系统提示:Enter the value of CYGWIN for the daemon:[] 回答:ntsec tty
5.系统提示:Do you want to use a different name ? 回答:no
6.好像还要输入密码
配置完成后,在系统服务中启动失败。
修改登录用户:
发生系统错误 1069。
由于登录失败而无法启动服务。
yes
yes
yes
ntsec tty
yes
cygwin
cygwin
yes
输入密码
Administrator@PC2012071012ysn ~
$ ssh-host-config
*** Query: Overwrite existing /etc/ssh_config file? (yes/no) yes
*** Info: Creating default /etc/ssh_config file
*** Query: Overwrite existing /etc/sshd_config file? (yes/no) yes
*** Info: Creating default /etc/sshd_config file
*** Info: Privilege separation is set to yes by default since OpenSSH 3.3.
*** Info: However, this requires a non-privileged account called 'sshd'.
*** Info: For more info on privilege separation read /usr/share/doc/openssh/README.privsep.
*** Query: Should privilege separation be used? (yes/no) yes
*** Info: Note that creating a new user requires that the current account have
*** Info: Administrator privileges. Should this script attempt to create a
*** Query: new local account 'sshd'? (yes/no) yes
*** Info: Updating /etc/sshd_config file
*** Query: Do you want to install sshd as a service?
*** Query: (Say "no" if it is already installed as a service) (yes/no) yes
*** Query: Enter the value of CYGWIN for the daemon: [] ntsec tty
*** Info: The sshd service has been installed under the LocalSystem
*** Info: account (also known as SYSTEM). To start the service now, call
*** Info: `net start sshd' or `cygrunsrv -S sshd'. Otherwise, it
*** Info: will start automatically after the next reboot.
*** Info: Host configuration finished. Have fun!
1.ssh-keygen然后一直回车
2.cd ~/.ssh
3.cp id_rsa.pub authorized_keys
4.exit 退出cygwin,若不退出,可能出错
6执行 ps 若看到 有/usr/bin/ssh 进程,说明成功