http://blog.csdn.net/cybercode/article/details/7080743

这篇文章主要是为我在win7(64位)下搭建hadoop环境所准备的。首先参照在cygwin使用总结这篇文章在cygwin中安装所必须得软件包,然后如下进行操作:

  1. sony@sony-VAIO~ $ ssh-host-config
  2. *** Info: Generating /etc/ssh_host_key
  3. *** Info: Generating /etc/ssh_host_rsa_key
  4. *** Info: Generating /etc/ssh_host_dsa_key
  5. *** Info: Generating /etc/ssh_host_ecdsa_key
  6. *** Info: Creating default /etc/ssh_config file
  7. *** Info: Creating default /etc/sshd_config file
  8. *** Info: Privilege separation is set to yes by default since OpenSSH 3.3.
  9. *** Info: However, this requires a non-privileged account called 'sshd'.
  10. *** Info: For more info on privilege separation read /usr/share/doc/openssh/READ
  11. ME.privsep.
  12. *** Query: Should privilege separation be used? (yes/no) no
  13. *** Info: Updating /etc/sshd_config file
  14. *** Query: Do you want to install sshd as a service?
  15. *** Query: (Say "no" if it is already installed as a service) (yes/no) yes
  16. *** Query: Enter the value of CYGWIN for the daemon: netsec] netsec
  17. *** Info: On Windows Server 2003, Windows Vista, and above, the
  18. *** Info: SYSTEM account cannot setuid to other users -- a capability
  19. *** Info: sshd requires.  You need to have or to create a privileged
  20. *** Info: account.  This script will help you do so.
  21. *** Info: You appear to be running Windows XP 64bit, Windows 2003 Server,
  22. *** Info: or later.  On these systems, it's not possible to use the LocalSystem
  23. *** Info: account for services that can change the user id without an
  24. *** Info: explicit password (such as passwordless logins [e.g. public key
  25. *** Info: authentication] via sshd).
  26. *** Info: If you want to enable that functionality, it's required to create
  27. *** Info: a new account with special privileges (unless a similar account
  28. *** Info: already exists). This account is then used to run these special
  29. *** Info: servers.
  30. *** Info: Note that creating a new user requires that the current account
  31. *** Info: have Administrator privileges itself.
  32. *** Info: No privileged account could be found.
  33. *** Info: This script plans to use 'cyg_server'.
  34. *** Info: 'cyg_server' will only be used by registered services.
  35. *** Query: Do you want to use a different name? (yes/no) yes
  36. *** Query: Enter the new user name: sony
  37. *** Query: Reenter: sony
  38. *** Warning: Privileged account 'sony' was specified,
  39. *** Warning: but it does not have the necessary privileges.
  40. *** Warning: Continuing, but will probably use a different account.
  41. *** Warning: The specified account 'sony' does not have the
  42. *** Warning: required permissions or group memberships. This may
  43. *** Warning: cause problems if not corrected; continuing...
  44. *** Query: Please enter the password for user 'sony':
  45. *** Query: Reenter:
  46. *** Info: The sshd service has been installed under the 'sony'
  47. *** Info: account.  To start the service now, call `net start sshd' or
  48. *** Info: `cygrunsrv -S sshd'.  Otherwise, it will start automatically
  49. *** Info: after the next reboot.
  50. *** Info: Host configuration finished. Have fun!

$ net start sshd
发生系统错误 1069 --- 表示由于登录失败而无法启动服务

解决方法:在cmd中输入services.msc即可打开windows的服务,在服务中把密码改对就可以了。
(在上面配置ssh的过程中我的用户名是:sony 密码是:123456)

sshd服务装成功如下:

  1. sony@sony-VAIO ~ $ net start sshd
  2. CYGWIN sshd 服务正在启动 .
  3. CYGWIN sshd 服务已经启动成功

接下来是配置无密码登陆:

  1. sony@sony-VAIO ~ $ ssh-keygen -t rsa
  2. Generating public/private rsa key pair.
  3. Enter file in which to save the key (/home/sony/.ssh/id_rsa):
  4. Created directory '/home/sony/.ssh'.
  5. Enter passphrase (empty for no passphrase):
  6. Enter same passphrase again:
  7. Your identification has been saved in /home/sony/.ssh/id_rsa.
  8. Your public key has been saved in /home/sony/.ssh/id_rsa.pub.
  9. The key fingerprint is:
  10. e8:38:5e:e3:bb:cf:76:03:61:5f:f2:68:ed:a3:49:db sony@sony-VAIO
  11. The key's randomart image is:
  12. +--[ RSA 2048]----+
  13. |                 |
  14. |                 |
  15. |                 |
  16. |       .o . .    |
  17. |      ..So *     |
  18. |     o  . + o    |
  19. |    o +  o..     |
  20. |   . + o..o+o    |
  21. |    . +=o.+oE.   |
  22. +-----------------+
  23. sony@sony-VAIO ~ $ cd .ssh/
  24. sony@sony-VAIO ~/.ssh $ ls
  25. id_rsa  id_rsa.pub
  26. sony@sony-VAIO ~/.ssh $ cp id_rsa.pub authorized_keys
  27. sony@sony-VAIO ~/.ssh $ ls
  28. authorized_keys  id_rsa  id_rsa.pub

验证如下:

    1. sony@sony-VAIO ~/.ssh $ ssh localhost
    2. The authenticity of host 'localhost (::1)' can't be established.
    3. ECDSA key fingerprint is 5f:21:b1:24:80:92:f6:af:3e:e3:a8:f9:cb:a4:4f:ec.
    4. Are you sure you want to continue connecting (yes/no)? yes
    5. Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
    6. sony@sony-VAIO ~ $ who
    7. sony     tty0         2011-11-25 15:42 (::1)

cygwin安装sshd服务并实现无密码登录的更多相关文章

  1. cygwin安装sshd服务(win7)Error installing a service: OpenSCManager: Win32 error 5:

    Error installing a service: OpenSCManager: Win32 error 5:           出现这个问题的解决办法:win7系统管理员运行Cygwin软件 ...

  2. 对于mariadb安装后可以默认使用无密码登录的问题解决方案

    mariadb安装后默认可以无密码登录 所以首先我们要设置root用户的密码 mysqladmin -u root -p password 密码 [遇到enter直接enter就行,注意,如果是重新设 ...

  3. windows下安装openssh服务并实现远程登录

    需要准备的工具: winscp 点击下载        openssh 点击下载  步骤: 在远程计算机安装 1.首先安装openssh,双击并安装 2.指定用户的home directory为C:\ ...

  4. 安装SSH、配置SSH无密码登录 ssh localhost

    集群.单节点模式都需要用到 SSH 登陆(类似于远程登陆,你可以登录某台 Linux 主机,并且在上面运行命令),Ubuntu 默认已安装了 SSH client,此外还需要安装 SSH server ...

  5. Ubuntu安装及sshd服务安装,yum安装等总结

    vm网络选择自定义.指定的虚拟网络,自动桥连.   1.设置root初始密码 ubuntu安装好后,root初始密码(默认密码)不知道,需要设置.1.先用安装时候的用户登录进入系统2.输入:sudo ...

  6. Windows 环境 cygwin 安装 SSH

    本文内容 安装环境 安装 cygwin 安装 SSH 服务 启动 sshd 服务 SSH 免密码登录 验证 SSH 是否已安装成功 验证 SSH 是否可以免密码登录本机 安装环境 Windows 20 ...

  7. CentOS下SSH无密码登录的配置

    1.确认本机sshd的配置文件(需要root权限) $ gedit /etc/ssh/sshd_config 找到以下内容,并去掉注释符"#" RSAAuthentication ...

  8. 使用commit方式构建具有sshd服务的centos镜像

    一般我们是通过SSH服务来管理服务器的,但是现在很多Docker镜像不带SSH服务,那我们该如何来管理这些容器呢?现在我们通常使用attach和nsenter工具.但是都无法解决远程管理容器的问题,当 ...

  9. ubuntu 安装 sshd

    ubuntu 上可以安装 SSHD 服务,方便远程操作. sudo apt-get update sudo apt-get install openssh-server sudo /etc/init. ...

随机推荐

  1. 【uoj126】 NOI2013—快餐店

    http://uoj.ac/problem/126 (题目链接) 题意 求基环树直径. Solution zz选手迟早退役,唉,右转题解→_→:LCF 细节 拓扑排序的时候度数为0时入队.我在想什么w ...

  2. Controller、Service、Dao进行Junit单元

    原文链接:http://blog.csdn.net/u013041642/article/details/71430293 Spring对Controller.Service.Dao进行Junit单元 ...

  3. mysql、mybatis遇到问题集合

    1.错误描述 使用JDBC连接MySql时出现:The server time zone value '�й���׼ʱ��' is unrecognized or represents more th ...

  4. SQL Server - 开窗函数

    -- 开窗函数:在结果集的基础上进一步处理(聚合操作) SELECT * FROM dbo.Student S# Sname Sage Ssex ---------- ---------- ----- ...

  5. HDFS之append数据到已存在文件中

    遇到一个问题,想往已存在的hdfs文件中直接添加数据,默认的话应该是被拒绝的.查看了一些资料,可以这样操作: 在pdfs-site.xml中添加append支持: <property> & ...

  6. SQL存储过程例子

    存储过程呢,学校里学习的都是简单的.这里是我在工作的时候写的存储过程,贴出来,其中公司相关我都XXX代替了 (注:这个例子可以算是动态SQL的例子了,写死的是静态SQL,这个很灵活的传入参数的是动态S ...

  7. python操作txt文件中数据教程[4]-python去掉txt文件行尾换行

    python操作txt文件中数据教程[4]-python去掉txt文件行尾换行 觉得有用的话,欢迎一起讨论相互学习~Follow Me 参考文章 python操作txt文件中数据教程[1]-使用pyt ...

  8. Solr记录-solr介绍及配置

    Solr是一个开源搜索平台,用于构建搜索应用程序. 它建立在Lucene(全文搜索引擎)之上. Solr是企业级的,快速的和高度可扩展的. 使用Solr构建的应用程序非常复杂,可提供高性能. 为了在C ...

  9. SQL记录-PLSQL包

    PL/SQL包 PL/SQL包是组逻辑相关的PL/SQL类型,变量和子程序模式对象. 程序包将有两个强制性的部分: 包装规范定义 包体或定义 包装规范定义 规范是接口到包.它只是声明的类型,变量,常量 ...

  10. Javascript你不知道的那些事!(数字计算篇-变态篇)无意中聊天发现的一些奇怪的事情

    javascript:alert(0.1 + 0.2) 如果看到这样一道题你会怎么思考了!大家肯定第一反应0.3,但是考虑到我已经这样问了!那么幼稚的答案我会专门写篇文章吗 然后人就开始折磨自己了会不 ...