虚拟机XP 连接 虚拟机 linux

使用软件: putty

虚拟机都使用   NAT  这样他们处于 一个网段中


linux 下  ifcondif  查看IP

XP    下   ipconfig  查看IP

linux 下查看 用户 密码等  cat /etc/passwd

问题:
  使用putty登录显示network error:Connection refused 或者显示network error:Connection timeout 

解决方法:
  1.vi /etc/ssh/sshd_config 将PermitRootLogin的注释取消,或者将no改为yes。(如果没有sshd_config文件说明linux上没有安装SSH,使用 yum -y  install ssh安装之后,sshd-config文件中PermitRootLogin选项默认的是yes,新安装的ssh不用操作下面两部)
  2.
root@bt:~# /etc/init.d/ssh restart
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
 * Restarting OpenBSD Secure Shell server sshd                                                                  Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key


解决方法:
root@bt:~# ssh-keygen -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.
The key fingerprint is:
85:e6:83:c5:a9:91:0d:8e:2a:6b:b1:e5:7b:db:d3:b2 root@bt
The key's randomart image is:
+--[ RSA 2048]----+
|      .          |
|     o = o       |
|    . + B .      |
|   .   B .       |
|....  o S        |
| o=      .       |
|.o .    .        |
|.   ...o .       |
|   ....E+        |
+-----------------+


root@bt:~# ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
Generating public/private dsa key pair.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /etc/ssh/ssh_host_dsa_key.
Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub.
The key fingerprint is:
bc:0d:45:c8:62:85:c4:6e:a2:90:e4:3b:e4:38:8a:35 root@bt
The key's randomart image is:
+--[ DSA 1024]----+
|     o.+...      |
| .    = o.       |
|o.   o .  .      |
|oo  . o. .       |
|+... o  S        |
|o+E      +       |
|oo..    . .      |
|o                |
|                 |
+-----------------+


  3.service iptables stop命令进入将防火墙关闭。

最后  登陆 用 root 账户登陆





另外   更新  MSF  :   http://blog.chinaunix.net/uid-13344516-id-3597709.html







转载于:https://www.cnblogs.com/zcc1414/p/3982376.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值