Hadoop之——cygwin+ssh及启动ssh服务失败、ssh localhost失败的解决方案

转载请注明出处:http://blog.csdn.net/l1028386804/article/details/46646585

在Windows2003中配置ssh服务

在vm里成功做了一个ssh服务器,以下对这个过程做个总结。

步骤一

在vm win2k3里安装cygwin环境,虚拟机上不了外网,所以就在我的工作机上下载了一个cygwin的安装包,完整的,640M。

把这个包拷贝到虚拟机里面,完全安装,

安装的中间出现很奇怪的进度显示,如下所示。

安装了很长时间,至少有1h,完成之后,双击cygwin无法使用。在另一台虚拟机里也试着安装了一下,也是没有成功。很郁闷。

步骤二

把我自己的工作机(winxp)上的cygwin的安装包压缩后传到vm上,1,8G

,上传之后解压到C盘。到cygwin目录下,双击Cygwin.bat,成功打开bash环境。在桌面上做了一个快捷键。如下

步骤三:

配置ssh服务器。

1)  添加环境变量CYGWIN和path。

2)  授权。
chmod +r /etc/group
chmod +r /etc/passwd
chmod +rwx /var
3)  安装sshd服务
$ ssh-host-config      # 引导SSH服务配置

*** Info: Generating /etc/ssh_host_key

*** Info: Generating /etc/ssh_host_rsa_key

*** Info: Generating /etc/ssh_host_dsa_key

*** Info: Creating default /etc/ssh_configfile

*** Info: Creating default /etc/sshd_configfile

*** Info: Privilege separation is set toyes by default since OpenSSH 3.3.

*** Info: However, this requires anon-privileged account called ‘sshd‘.

*** Info: For more info on privilegeseparation read /usr/share/doc/openssh/READ

ME.privsep.

*** Query: Should privilege separation beused? (yes/no) yes  #输入yes

*** Info: Updating /etc/sshd_config file

*** Warning: The following functionsrequire administrator privileges!

*** Query: Do you want to install sshd as aservice?

*** Query: (Say "no" if it isalready installed as a service) (yes/no) yes #输入yes

*** Info: Note that the CYGWIN variablemust contain at least "ntsec"

*** Info: for sshd to be able to changeuser context without password.

*** Query: Enter the value of CYGWIN forthe daemon: [ntsec] ntsec  #输入ntsec

*** Info: On Windows Server 2003, WindowsVista, and above, the

*** Info: SYSTEM account cannot setuid toother 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 Windows2003 Server or later.  On 2003 and

*** Info: later systems, it‘s not possibleto use the LocalSystem account

*** Info: for services that can change theuser id without an explicit password

*** Info: (such as passwordless logins[e.g. public key authentication] via sshd).

*** Info: If you want to enable thatfunctionality, it‘s required to create a new

*** Info: account with special privileges(unless a similar account already exists).

*** Info: This account is then used to runthese special servers.

*** Info: Note that creating a new userrequires that the current account have

*** Info: Administrator privileges itself.

*** Info: No privileged account could befound.

*** Info: This script plans to use‘cyg_server‘.

*** Info: ‘cyg_server‘ will only be used byregistered services.

*** Query: Do you want to use a differentname? (yes/no) no  #输入no,不指定启动用户

*** Query: Create new privileged useraccount ‘cyg_server‘? (yes/no) no  #输入no,不指定启动用户

*** ERROR: There was a serious problemcreating a privileged user.

*** Query: Do you want to proceed anyway?(yes/no) yes  #输入yes

*** Warning: Expected privileged user‘cyg_server‘ does not exist.

*** Warning: Defaulting to ‘SYSTEM‘

*** Info: The sshd service has beeninstalled under the LocalSystem

*** Info: account (also known as SYSTEM).To start the service now, call

*** Info: `net start sshd‘ or `cygrunsrv -Ssshd‘.  Otherwise, it

*** Info: will start automatically afterthe next reboot.

*** Info: Host configuration finished. Havefun!

4)  Net start sshd # 启动 SSH服务
5)  注意: 使用 windows 用户本地认证

mkpasswd-l > /etc/passwd  使用windows 用户的密码
mkgroup -l > /etc/group    使用windows 用户组
6)  启动完成之后ssh [email protected]提示输入密码,输入正确的密码,可以成功登陆,则ssh配置成功。

问题:

Q:安装的时候出现如下错误Error installing a service: OpenService: Win32 error 1073:

重新安装sshd服务,要先到注册表中删除对应的注册信息。

HKEY_LOCAL_MACHINE\HKEY_LOCAL_MACHINE\SYSTEM\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sshd

Q: cygrunsrv -Ssshd不能启动,报告

cygrunsrv: Error starting a service:QueryServiceStatus: Win32 error 1062:

The service has not been started.

A: 很可能是/var/log的权限设置不正确。首先执行mkpasswd和 mkgroup
重新生成权限信息,再删除sshd服务,重新配置:

$ mkpasswd -l > /etc/passwd
$ mkgroup -l > /etc/group
$ cygrunsrv -R sshd
$ ssh-host-config -y
$ cygrunsrv -S sshd
时间: 2024-08-25 15:23:55

Hadoop之——cygwin+ssh及启动ssh服务失败、ssh localhost失败的解决方案的相关文章

Android 启动Tomcat服务报错,端口占用解决方案

启动Tomcat服务器报错:Several ports (8005, 8080, 8009) required by Tomcat v5.5 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop

linux 修改 ssh 的端口号,启动hg服务

修改 ssh 的端口号 # vim /etc/ssh/sshd_config 将其中的 Port 改为 想要修改的端口号. # service sshd restart 启动hg服务 # hg serve --port PORT_NUM --web-conf hg.conf_FULL_PATH -d hg.conf_FULL_PATH 的内容 [paths]/your_hg_repo = /home/user_name/hgRepo/your_hg_repo ~/.hgrc 的内容 [web]p

初识Hadoop一,配置及启动服务

一.Hadoop简介: Hadoop是由Apache基金会所开发的分布式系统基础架构,实现了一个分布式文件系统(Hadoop Distributed File System),简称HDFS:Hadoop框架最核心设计就是HDFS和MapReduce,HDFS为海量数据提供了存储,MapReduce为海量数据提供了计算. Hadoop要解决的问题:海量数据的存储(HDFS).海量数据的分析(MapReduce)和资源管理调度(YARN) Hadoop主要作用于分布式 二.Hadoop实现机制 1.

使用kernel编译+busybox定制Linux系统--实现ssh远程登录+web服务的迷你主机

在运维工作中很多时候我们需要裁剪Linux系统,减少系统性能的消耗,提升系统服务的性能,以往通过光盘安装的Linux都是比较臃肿的,但出现这样的需求后,我可以对Linux进行重新编译再busybox工具移植即可实现,接下来我们一步一步实现kernel编译+busybox定制Linux系统--实现ssh远程登录+web服务: 实现过程如下: 一.规划子主机的磁盘存储规划 1.添加一个大小为10G的硬盘 2.查询系统硬件信息参数: # lspci  00:00.0 Host bridge: Inte

十(7)rsync:介绍、常用选项、通过ssh同步、通过服务同步、linux系统日志、screen

                        rsync工具介绍 rsync:数据备份工具(remote sync). rsync不仅可以远程同步数据(类似scp),而且可以本地同步数据(类似cp),但是不同于cp或scp的一点是,如果数据存在的话它不会覆盖以前的数据,而是会先判断已存在的数据是否和新的数据有差异,只有数据不同时才会把不同的部分覆盖.  (系统如果没有rsync命令,安装:yum install -y rsync) (如:有两台机器A.B,要把A的数据每小时都备份到B下,而且A

使用telnet服务和ssh服务在真实机上访问h3c模拟器中的路由器

要使用telnet服务和ssh服务访问路由器,就要先ping通真实机与模拟路由器的ip地址,步骤如下:1.在华三模拟器上添加并启动MR36_20_1的路由器和host主机. 2.在真实机上添加一块新的网卡,win 10 的添加微软的回环适配器即可,并将ip地址设置为192.168.1.10. 3.然后在华三模拟器上用线连接路由器和host主机的回环网卡. 4.在路由器上点击右键选择"配置终端命令".Systelnet server enableint g0/0ip add 192.16

Linux中通过ssh将客户端与服务端的远程连接

前提需要:1.在VMware中装上两台linux虚拟机,本博客使用的都是CentOS 7.2.两部虚拟机可以通过命令ping通.3.两部虚拟机中已经通过yum本地仓库安装了sshd服务. 首先  1.执行命令 :yum install sshd 安装sshd服务         2.启动sshd服务 命令:systemctl start sshd         3.查看是否有22号端口因为以后要用到  命令:netstat -an|more 再来介绍一下我使用的虚拟机以及所配置的IP1. hb

[SSH服务]——一个SSH无密码登陆实验

实验拓扑图 实验描述 机房内有两台服务器: (1)B服务器10.0.10.158,充当Web服务器,有普通用户user_00 (2)C服务器10.0.10.191,充当Mysql服务器,有普通用户user_00 有服务器A 10.0.10.198,供管理员平常使用来管理机房内的机器.为方便起见,所以要求做到: (1)A服务器能SSH远程登录(以user_00的身份)到B和C,且实现无密码登陆: (2)远程登录后,user_00可以直接sudo到root而不需要密码. 在服务器B:10.0.10.

使用ssh开发rest web服务支持http etag header的教程详解

原创整理不易,转载请注明出处:使用ssh开发rest web服务支持http etag header的教程详解 代码下载地址:http://www.zuidaima.com/share/1777391667989504.htm 导言 REST方式的应用程序构架在近日所产生的巨大影响突出了Web应用程序的优雅设计的重要性.现在人们开始理解"WWW架构"内在的可测量性及弹性,并且已经开始探索使用其范例的更好的方式.在本文中,我们将讨论一个Web应用开发工具--"简陋的.卑下的&q

linux服务之ssh

一,查看版本[[email protected] ~]# ssh -VOpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010                    表明该系统正在使用OpenSSHssh -V ssh: SSH Secure Shell 3.2.9.1 (non-commercial version) on i686-pc-linux-gnu    表明该系统正在使用SSH2 二,首次使用当你第一次使用ssh登录远程主机时,会出现没有找到主机密