cygwin安装成功后,连接 ssh localhost,一直出现
cygwin Connection closed by ::1的错误,费了很多时间查找,总算解决了,原文如下:
在google上看到cygwin的一个官方mail问答。参考Installing the Cygwin SSH daemon 。问题关键就是一个特殊的权限问题,在SYSTEM账户下运行的sshd服务需要有改变user id的特权(关于权限的问题,在cygwin的/usr/share/doc/Cygwin/openssh.README 中已经说得很明确了:2003 Server has a funny new feature. When starting services under SYSTEM account, these services have nearly all user rights which SYSTEM holds...except for the "Create a token object" right, which is needed to allow public key authentication :-( )。所以事件日志会有seteuid的错误。
至于解决方案,就是让cygwin帮你创建两个特殊用户sshd和cyg_server,其中sshd服务在cyg_server用户下运行,cyg_server有相应的权限(在/usr/share/doc/Cygwin/openssh.README 中也有说明)。
***** 关键的就是这两个用户都要创建。
在配置的时候注意一下几点:
1.当屏幕显示关于“privilege seperation”,输入yes后回车;
当屏幕显示关于“create local user sshd”,输入yes后回车;
*** Query: Should privilege separation be used? (yes/no) yes #输入yes
*** Info: Updating /etc/sshd_config file
*** Warning: The following functions require administrator privileges!
*** Query: Do you want to install sshd as a service?
*** Query: (Say "no" if it is already installed as a service) (yes/no) yes #输入yes
*** Info: Note that the CYGWIN variable must contain at least "ntsec"
*** Info: for sshd to be able to change user context without password.
*** Query: Enter the value of CYGWIN for the daemon: []
*** Info: On Windows Server 2003, Windows Vista, and above, the
设置的 cyg_server密码要记清楚,在win的服务里面用这个用户启动ssh服务,密码和这里设置的要一样
2. ssh-host-config重新配置
如果初始配置错误,大部分网上都建议全部删除再重新安装,但cygwin一旦安装很难完全卸载,只需要把ssh服务停止再重新执行这个命令,再把之前的覆盖掉就可以。
步骤:1.sc delete sshd
2.系统重启,就再配置就ok了
3.*** Info: This script plans to use 'cyg_server'.
*** Info: 'cyg_server' will only be used by registered services.
*** Query: Do you want to use a different name? (yes/no) no
*** Query: Create new privileged user account 'cyg_server'? (yes/no) yes
*** Info: Please enter a password for new user cyg_server. Please be sure
*** Info: that this password matches the password rules given on your system.
*** Info: Entering no password will exit the configuration.
*** Query: Please enter the password:
*** Query: Reenter:
4.执行ssh的key-keygen生成密钥文件,进行免密码登陆后,执行和退出界面如下。
相关推荐
本篇内容详细介绍了cygwin的安装过程,资源配置及简单命令的使用等信息。cygwin是一个在windows平台上运行的unix模拟环境,它对于学习unix/linux操作环境,或者从unix到windows的应用程序移植,或者进行某些特殊的...
在Windows下本地安装Cygwin,在Windows下本地安装Cygwin
对于omniORB在windows环境下的安装配置,其中Cygwin编译器用来对omniORB的源码进行编译;该文档对Cygwin在windows下的安装配置进行介绍。
windows下安装Cygwin指南含安装包
Eclipse下配置NDK不用安装Cygwin
win7下Cygwin搭建Hadoop开发环境
双击打开下载完成的cygwin,进入安装程序首页,下一步 扩展包的安装方式选择,默认即可(从网上下载并安装),下一步 选择软件的安装目录和允许使用的用户,默认即可,下一步 选择从网上下载的软件包的存储路径,...
介绍在Windows下快速安装Cygwin,详细,简单,一步一步操作就可以了。
Cygwin安装和openssh配置.\Cygwin安装和openssh配置
cygwin的安装和简单配置,可供初学者参考。。
Windows下的SSH安装之Cygwin
在Windows下利用cygwin仿unix环境安装配置Hadoop
下载安装Cygwin方法 下载安装Cygwin方法
cygwin下安装wxpython的英文资料
详细介绍windows下,下载安装cygwin进行搭建hadoop开发环境过程。
包含: Cygwin setup-x86_64.exe 官网最新版 apt-cyg tcpreplay-4.4.1.tar.gz WpdPack_4_1_2.zip
如何将Cygwin安装完全 -- 如何将Cygwin安装完全 -- 如何将Cygwin安装完全
cygwin是一个在windows平台上运行的unix模拟环境,是cygnus solutions公司开发的自由软件(该公司开发了很多好东西,著名的还有eCos,不过现已被Redhat收购)。它对于学习unix/linux操作环境,或者从unix到windows的...
Win10不需要Cygwin搭建大数据测试环境搭建hive的bin文件(包含官方版本中缺少的cmd文件),完美解决windows环境下配置hive时,找不到hive命令问题