ssh 配置的一些问题

1. ssh启动错误:no hostkeys available— exiting

  1. 在 hadoop 伪分布配置安装的教程里

http://dblab.xmu.edu.cn/blog/2441-2/

在“安装SSH、配置SSH无密码登陆”这一步,启动 ssh 时,

sudo /etc/init.d/ssh start

出现了问题:

no hostkeys available— exiting
  1. 解决办法(使用 root 权限运行):
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key

2. ssh localhost,出现 Permission denied (publickey)

  1. 登录普通用户的时候运行:
ssh loalhost

出现错误:

localhost: Permission denied (publickey).
  1. 解决办法
cd ~/.ssh/                     			# 若没有该目录,请先执行一次ssh localhost
ssh-keygen -t rsa              			# 会有提示,都按回车就可以
cat ./id_rsa.pub >> ./authorized_keys  	# 加入授权
  1. 再次运行:
ssh localhost

结果:

zhiyong@LAPTOP-OC4RD91F:/home/zhiyong$ ssh localhost
Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 4.4.0-19041-Microsoft x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Nov 16 14:54:10 CST 2020

  System load:    0.52      Processes:             14
  Usage of /home: unknown   Users logged in:       0
  Memory usage:   42%       IPv4 address for eth1: 192.168.0.76
  Swap usage:     0%


6 updates can be installed immediately.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable


*** System restart required ***
Last login: Mon Nov 16 12:16:37 2020 from 127.0.0.1
hadoop@LAPTOP-OC4RD91F:~$



3.这样,搭建伪分布式的 Hadoop 环境的 ssh 配置就可以搭配好了

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值