当前位置:   article > 正文

【Linux】ERROR: ssh: connect to host hdp102 port 22: Connection refused

connect to host hdp102 port 22: connection refused

一、问题


安装hadoop的时候,需要配置ssh无密登录   ,  然后就

  1. [root@hdp101 software]# ssh-copy-id -i /root/.ssh/id_rsa.pub hdp102
  2. /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
  3. /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
  4. /usr/bin/ssh-copy-id: ERROR: ssh: connect to host hdp102 port 22: Connection refused

二、解决


缺少 sshd,我们需要安装下。

  1. [root@hdp101 software]# yum install openssh-server
  2. Loaded plugins: fastestmirror
  3. Loading mirror speeds from cached hostfile
  4.  * base: mirror.lzu.edu.cn
  5.  * extras: mirror.lzu.edu.cn
  6.  * updates: mirror.lzu.edu.cn
  7. Package openssh-server-7.4p1-21.el7.x86_64 already installed and latest version
  8. Nothing to do

SSH 启动   

service sshd restart

查看服务

  1. [root@hdp102 yum.repos.d]# systemctl status sshd.service
  2. ● sshd.service - OpenSSH server daemon
  3. Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
  4. Active: active (running) since Sat 2021-01-23 19:43:03 CST; 6s ago
  5. Docs: man:sshd(8)
  6. man:sshd_config(5)
  7. Main PID: 7723 (sshd)
  8. CGroup: /system.slice/sshd.service
  9. └─7723 /usr/sbin/sshd -D
  10. Jan 23 19:43:03 hdp102 systemd[1]: Starting OpenSSH server daemon...
  11. Jan 23 19:43:03 hdp102 sshd[7723]: Server listening on 0.0.0.0 port 22.
  12. Jan 23 19:43:03 hdp102 sshd[7723]: Server listening on :: port 22.
  13. Jan 23 19:43:03 hdp102 systemd[1]: Started OpenSSH server daemon.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/187714
推荐阅读
相关标签
  

闽ICP备14008679号