SSH登录之解决端口无响应

来源:互联网 发布:苹果手机变成3g网络了 编辑:程序博客网 时间:2024/05/11 17:40
  两台机子,A(ip:192.168.1.106)使用ssh连接B(ip:192.168.1.107),
     在A上面输入:
ssh 192.168.1.107 
    回车后出现:
sshconnect to host 192.168.1.107 port 22Connection refused
    这个是因为B机上面ssh没有openssh的组件,一般是没有:openssh-server
    然后在B机上面安装:
sudo apt-get install openssh-client
sudo apt-get install openssh-server
    再然后:在B机上面重启ssh:
sudo /etc/init.d/ssh restart
    停止ssh:
sudo /etc/init.d/ssh stop
    开启ssh: 
sudo /etc/init.d/ssh start
    然后以root登录:
ssh -l root 192.168.1.107
    然后提示你输入密码:
root@192.168.1.107's password:
    之后:
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTYto the extent permitted by
applicable law.
Welcome to Ubuntu 13.04 (GNU/Linux 3.8.0-34-generic i686)
 * Documentation:  https://help.ubuntu.com/
Your Ubuntu release is not supported anymore.
For upgrade informationplease visit:
http://www.ubuntu.com/releaseendoflife
New release '13.10' available.
Run 'do-release-upgrade' to upgrade to it.
    接下来就可以操作了.
0 0
原创粉丝点击