zoukankan      html  css  js  c++  java
  • Ubuntu 安装配置SSH(ssh: connect to host localhost port 22: Connection refused问题的解决)

    为什么要安装SSH?因为在Hadoop启动以后,namenode是通过SSH(Secure Shell)来启动和停止各个节点上的各种守护进程的。作为一个菜鸟,第一次使用Hadoop,安装配置有点复杂,到Ubuntu配置SSH这一步时,有点问题,经过琢磨后,发现了奥秘,现在把自己的一些心得分享下。

    Ubuntu默认并没有安装ssh服务,如果通过ssh链接Ubuntu,需要自己手动安装openssh-server。判断是否安装ssh服务,可以通过如下命令进行:

    ssh localhost

    结果我在这里发现了一个问题,如下:

    Ubuntu 安装配置SSH(ssh: connect to host localhost port

    问题分析如下:出现这个问题是因为Ubuntu默认没有安装openssh-server,我们用一个命令来看下,如果只有agent,说明没有安装openssh-server,命令如下:

    ps -e|grep ssh

    效果如下:

    Ubuntu 安装配置SSH(ssh: connect to host localhost port

    既然问题找到了,我们就开始用命令来安装openssh-server,命令如下:

    sudo apt-get install openssh-server

    安装完成后,我们再用ps -e|grep ssh命令来看下,openssh-server安装上去没有。输入命令后出现如下截图,说明安装完毕,图中sshd就是我们所安装的。

    ps -e|grep ssh

    Ubuntu 安装配置SSH(ssh: connect to host localhost port

    最后,我们通过ssh localhost命令来看下,这个命令主要用来连接本机如果出现要输入密码,说明成功。

    ssh localhost 

    Ubuntu 安装配置SSH(ssh: connect to host localhost port

    转自:https://www.linuxidc.com/Linux/2015-01/112045.htm

  • 相关阅读:
    nginx 安装部署
    cordova 安装使用
    git 设置和取消代理
    SQL语句 合并列值 将一列的多个值合并成一行
    idea 注册码 地址:
    mac 安装redis
    redisTemplate 方法
    js 点击 隐藏弹出层
    windows 安装redis
    docker 安装redis
  • 原文地址:https://www.cnblogs.com/maybach/p/14298187.html
Copyright © 2011-2022 走看看