cygwin安装sshd服务并实现无密码登录
http://blog.csdn.net/cybercode/article/details/7080743
这篇文章主要是为我在win7(64位)下搭建hadoop环境所准备的。首先参照在cygwin使用总结这篇文章在cygwin中安装所必须得软件包,然后如下进行操作:
- sony@sony-VAIO~ $ ssh-host-config
- *** Info: Generating /etc/ssh_host_key
- *** Info: Generating /etc/ssh_host_rsa_key
- *** Info: Generating /etc/ssh_host_dsa_key
- *** Info: Generating /etc/ssh_host_ecdsa_key
- *** Info: Creating default /etc/ssh_config file
- *** 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/READ
- ME.privsep.
- *** Query: Should privilege separation be used? (yes/no) no
- *** 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: netsec] netsec
- *** Info: On Windows Server 2003, Windows Vista, and above, the
- *** Info: SYSTEM account cannot setuid to other users -- a capability
- *** Info: sshd requires. You need to have or to create a privileged
- *** Info: account. This script will help you do so.
- *** Info: You appear to be running Windows XP 64bit, Windows 2003 Server,
- *** Info: or later. On these systems, it's not possible to use the LocalSystem
- *** Info: account for services that can change the user id without an
- *** Info: explicit password (such as passwordless logins [e.g. public key
- *** Info: authentication] via sshd).
- *** Info: If you want to enable that functionality, it's required to create
- *** Info: a new account with special privileges (unless a similar account
- *** Info: already exists). This account is then used to run these special
- *** Info: servers.
- *** Info: Note that creating a new user requires that the current account
- *** Info: have Administrator privileges itself.
- *** Info: No privileged account could be found.
- *** 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) yes
- *** Query: Enter the new user name: sony
- *** Query: Reenter: sony
- *** Warning: Privileged account 'sony' was specified,
- *** Warning: but it does not have the necessary privileges.
- *** Warning: Continuing, but will probably use a different account.
- *** Warning: The specified account 'sony' does not have the
- *** Warning: required permissions or group memberships. This may
- *** Warning: cause problems if not corrected; continuing...
- *** Query: Please enter the password for user 'sony':
- *** Query: Reenter:
- *** Info: The sshd service has been installed under the 'sony'
- *** Info: account. To start the service now, call `net start sshd' or
- *** Info: `cygrunsrv -S sshd'. Otherwise, it will start automatically
- *** Info: after the next reboot.
- *** Info: Host configuration finished. Have fun!
$ net start sshd
发生系统错误 1069 --- 表示由于登录失败而无法启动服务
解决方法:在cmd中输入services.msc即可打开windows的服务,在服务中把密码改对就可以了。
(在上面配置ssh的过程中我的用户名是:sony 密码是:123456)
sshd服务装成功如下:
- sony@sony-VAIO ~ $ net start sshd
- CYGWIN sshd 服务正在启动 .
- CYGWIN sshd 服务已经启动成功
接下来是配置无密码登陆:
- sony@sony-VAIO ~ $ ssh-keygen -t rsa
- Generating public/private rsa key pair.
- Enter file in which to save the key (/home/sony/.ssh/id_rsa):
- Created directory '/home/sony/.ssh'.
- Enter passphrase (empty for no passphrase):
- Enter same passphrase again:
- Your identification has been saved in /home/sony/.ssh/id_rsa.
- Your public key has been saved in /home/sony/.ssh/id_rsa.pub.
- The key fingerprint is:
- e8:38:5e:e3:bb:cf:76:03:61:5f:f2:68:ed:a3:49:db sony@sony-VAIO
- The key's randomart image is:
- +--[ RSA 2048]----+
- | |
- | |
- | |
- | .o . . |
- | ..So * |
- | o . + o |
- | o + o.. |
- | . + o..o+o |
- | . +=o.+oE. |
- +-----------------+
- sony@sony-VAIO ~ $ cd .ssh/
- sony@sony-VAIO ~/.ssh $ ls
- id_rsa id_rsa.pub
- sony@sony-VAIO ~/.ssh $ cp id_rsa.pub authorized_keys
- sony@sony-VAIO ~/.ssh $ ls
- authorized_keys id_rsa id_rsa.pub
验证如下:
- sony@sony-VAIO ~/.ssh $ ssh localhost
- The authenticity of host 'localhost (::1)' can't be established.
- ECDSA key fingerprint is 5f:21:b1:24:80:92:f6:af:3e:e3:a8:f9:cb:a4:4f:ec.
- Are you sure you want to continue connecting (yes/no)? yes
- Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
- sony@sony-VAIO ~ $ who
- sony tty0 2011-11-25 15:42 (::1)
cygwin安装sshd服务并实现无密码登录的更多相关文章
- cygwin安装sshd服务(win7)Error installing a service: OpenSCManager: Win32 error 5:
Error installing a service: OpenSCManager: Win32 error 5: 出现这个问题的解决办法:win7系统管理员运行Cygwin软件 ...
- 对于mariadb安装后可以默认使用无密码登录的问题解决方案
mariadb安装后默认可以无密码登录 所以首先我们要设置root用户的密码 mysqladmin -u root -p password 密码 [遇到enter直接enter就行,注意,如果是重新设 ...
- windows下安装openssh服务并实现远程登录
需要准备的工具: winscp 点击下载 openssh 点击下载 步骤: 在远程计算机安装 1.首先安装openssh,双击并安装 2.指定用户的home directory为C:\ ...
- 安装SSH、配置SSH无密码登录 ssh localhost
集群.单节点模式都需要用到 SSH 登陆(类似于远程登陆,你可以登录某台 Linux 主机,并且在上面运行命令),Ubuntu 默认已安装了 SSH client,此外还需要安装 SSH server ...
- Ubuntu安装及sshd服务安装,yum安装等总结
vm网络选择自定义.指定的虚拟网络,自动桥连. 1.设置root初始密码 ubuntu安装好后,root初始密码(默认密码)不知道,需要设置.1.先用安装时候的用户登录进入系统2.输入:sudo ...
- Windows 环境 cygwin 安装 SSH
本文内容 安装环境 安装 cygwin 安装 SSH 服务 启动 sshd 服务 SSH 免密码登录 验证 SSH 是否已安装成功 验证 SSH 是否可以免密码登录本机 安装环境 Windows 20 ...
- CentOS下SSH无密码登录的配置
1.确认本机sshd的配置文件(需要root权限) $ gedit /etc/ssh/sshd_config 找到以下内容,并去掉注释符"#" RSAAuthentication ...
- 使用commit方式构建具有sshd服务的centos镜像
一般我们是通过SSH服务来管理服务器的,但是现在很多Docker镜像不带SSH服务,那我们该如何来管理这些容器呢?现在我们通常使用attach和nsenter工具.但是都无法解决远程管理容器的问题,当 ...
- ubuntu 安装 sshd
ubuntu 上可以安装 SSHD 服务,方便远程操作. sudo apt-get update sudo apt-get install openssh-server sudo /etc/init. ...
随机推荐
- 【bzoj2754】 SCOI2012—喵星球上的点名
http://www.lydsy.com/JudgeOnline/problem.php?id=2754 (题目链接) 题意 给出$n$个名字串,$m$个点名串,问对于每一个姓名串,它包含多少个点名串 ...
- Mysql(二)函数与连接
一.函数 1.if函数 if(exp1, exp2, exp3) 判断exp1是否为true(不为0,并且不为nlll),如果为true,返回 exp2的值,否则返回exp3的值. selec ...
- NO.2: 尽量以const,enum,inline 替换 #define
1.首先#define 定义不重视作用域(scope),虽然可以#undef控制,但是不美观,还存在多次替换的问题,以及没有任何封装性. 2.const XXX_XX,保证其常量性以及可控的作用域,如 ...
- WebService和Http的POST和GET请求区别和示例
web service(SOAP) Webservice的一个最基本的目的就是提供在各个不同平台的不同应用系统的协同工作能力.Web service 就是一个应用程序,它向外界暴露出一个能够通过Web ...
- JAVA-Servlet内容
Servlet重定向 HttpServletResponse接口的sendRedirect()方法可以用于将响应重定向到另一个资源,资源可能是servlet,jsp或html文件. 它接受相对和绝对U ...
- git 学习小记
话说 git 出了已经很久了,可是我一直没用过.其实也不是没用过,只不过在 github 上下载东西那根本就不是在用 git,只是单纯的HTTP下载而已.我们公司用的是 svn,所以我只会一点点svn ...
- [原]JUnit 自定义扩展思路
1. 理解Annotation,http://www.cnblogs.com/mandroid/archive/2011/07/18/2109829.html 2. JUNIT整体执行过程分析,htt ...
- 浅说Get请求和Post请求
Web 上最常用的两种 Http 请求就是 Get 请求和 Post 请求了.我们在做 java web 开发时,也总会在 servlet 中通过 doGet 和 doPost 方法来处理请求:更经常 ...
- CSS-3 box-shadow 的使用
box-shadow是给对象实现图层阴影效果的. 语法: E {box-shadow: <length> <length> <length>?<length& ...
- python中的__new__、__init__和__del__
__new__.__init__.__del__三个方法用于实例的创建和销毁,在使用python的类中,我们最常用的是__init__方法,通常称为构造方法,__new__方法几乎不会使用,这篇文章是 ...