免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: laohuanggua
打印 上一主题 下一主题

悲剧啊!winxp宿主机ssh登录不上虚拟机。但是另外一个win虚拟机就能连接上!! [复制链接]

论坛徽章:
0
11 [报告]
发表于 2009-11-05 10:13 |只看该作者
先ping 看看能否ping通

论坛徽章:
0
12 [报告]
发表于 2009-11-05 19:32 |只看该作者
可以ping的通!

又建立一个ubuntu 9.10 server的虚拟机。发现同样pietty链接不上!!但是这个虚拟机也能ping通。也能上网安装软件。。。。

[ 本帖最后由 laohuanggua 于 2009-11-5 19:33 编辑 ]

论坛徽章:
0
13 [报告]
发表于 2009-11-05 20:30 |只看该作者
建议楼主发个/etc/ssh/sshd_config文件看看,不知道你的系统这个东西是不是在这个位置

论坛徽章:
0
14 [报告]
发表于 2009-11-05 23:16 |只看该作者
[root@localhost ~]# cat /etc/ssh/sshd_config
#       $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.

#Port 22
#Protocol 2,1
Protocol 2
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
ListenAddress 192.168.1.54
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 768

# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile     .ssh/authorized_keys

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication mechanism.
# Depending on your PAM configuration, this may bypass the setting of
# PasswordAuthentication, PermitEmptyPasswords, and
# "PermitRootLogin without-password". If you just want the PAM account and
# session checks to run without PAM authentication, then enable this but set
# ChallengeResponseAuthentication=no
#UsePAM no
UsePAM yes

# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none

# no default banner path
#Banner /some/path

# override default of no subsystems
Subsystem       sftp    /usr/libexec/openssh/sftp-server

论坛徽章:
0
15 [报告]
发表于 2009-11-05 23:19 |只看该作者
我估计不是配置文件的事情。---因为我的另外一个win2003虚拟机可以通过pietty登录上。


而是我的宿主机winxp的原因,但是我不清楚到底是什么导致突然链接不上!!能ping通,但是无法sssh登录成功!!!换了putty也不行!!!

论坛徽章:
0
16 [报告]
发表于 2009-11-06 09:01 |只看该作者
原帖由 laohuanggua 于 2009-11-5 23:19 发表
我估计不是配置文件的事情。---因为我的另外一个win2003虚拟机可以通过pietty登录上。


而是我的宿主机winxp的原因,但是我不清楚到底是什么导致突然链接不上!!能ping通,但是无法sssh登录成功!!!换了 ...


你是 宿主机可以 登录到 虚拟的2003 上

感觉是 你 的 ssh 服务没有启动
/etc/init.d/sshd start


然后 ssh 127.0.0.1

[root@jl ~]# /etc/init.d/sshd stop
Stopping sshd:                                             [  OK  ]
[root@jl ~]# ssh 127.0.0.1
ssh: connect to host 127.0.0.1 port 22: Connection refused
[root@jl ~]# ps -ef|grep ssh
lei       3321  3156  0 08:37 ?        00:00:00 /usr/bin/ssh-agent /bin/sh -c exec -l /bin/bash -c "gnome-session"
root      6048  3614  0 08:59 pts/0    00:00:00 grep ssh


[root@jl ~]# /etc/init.d/sshd start
Starting sshd:                                             [  OK  ]
[root@jl ~]# ssh 127.0.0.1
The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
RSA key fingerprint is 0b:b0:92:18:e2:e5:58:ec:f8:91:af:97:cc:62:48:be.
Are you sure you want to continue connecting (yes/no)?

论坛徽章:
0
17 [报告]
发表于 2009-11-06 17:04 |只看该作者
我在虚拟机上运行
ssh localhost
报告:
connect to host localhost port 22 connection refused

在虚拟机上别ssh  localhost ,直接跟IP看看。看你的本地网络解析localhost 到哪去了,hosts 文件又是怎么写的。你在虚拟2003上SSH能登入这台linux,说明这个虚拟机的SSH服务没问题的。从在里WinXP telnet  虚拟机的IP 22端口看看吧

[ 本帖最后由 Elinc 于 2009-11-6 17:23 编辑 ]

论坛徽章:
0
18 [报告]
发表于 2009-11-08 04:44 |只看该作者
我在虚拟机上运行
ssh localhost
报告:
connect to host localhost port 22 connection refused


看你配置文件没开localhost端,去掉 “#ListenAddress 0.0.0.0” 这一行的注释,把下面192.168.x.x那行注释掉后重开sshd试试

论坛徽章:
0
19 [报告]
发表于 2009-11-08 20:23 |只看该作者
感谢各位。我的sshd_config文件应该没问题,要不然就无法从另外的win2003和ubuntu 910虚拟机上ssh过来了。同时网卡也是桥接而非nat的。最后判断是winxp宿主机系统出了问题。


于是我丢掉了用了多年的xp,而改用win7。目前安装的是win7 65907版,已经激活。安装了虚拟机后发现pietty链接成功!!!同时很吃惊的发现,win7下安装的centos5.4,居然默认selinux是没有启动的!!!

论坛徽章:
0
20 [报告]
发表于 2009-11-13 22:41 |只看该作者

回复 #1 laohuanggua 的帖子

虚拟机的网络设置问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP