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

一、问题


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

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

/usr/bin/ssh-copy-id: ERROR: ssh: connect to host hdp102 port 22: Connection refused

二、解决


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

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

SSH 启动   

service sshd restart

查看服务

[root@hdp102 yum.repos.d]# systemctl status  sshd.service
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2021-01-23 19:43:03 CST; 6s ago
     Docs: man:sshd(8)
           man:sshd_config(5)
 Main PID: 7723 (sshd)
   CGroup: /system.slice/sshd.service
           └─7723 /usr/sbin/sshd -D

Jan 23 19:43:03 hdp102 systemd[1]: Starting OpenSSH server daemon...
Jan 23 19:43:03 hdp102 sshd[7723]: Server listening on 0.0.0.0 port 22.
Jan 23 19:43:03 hdp102 sshd[7723]: Server listening on :: port 22.
Jan 23 19:43:03 hdp102 systemd[1]: Started OpenSSH server daemon.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

阿龙先生啊

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值