Hadoop:权限被拒绝(公钥,密码,键盘交互)

时间:2020-05-29 13:45:26

标签: hadoop ssh localhost macos-catalina hadoop3

在安装Hadoop时,我遇到了很多错误,但是这个错误并没有解决。不管我做什么,它都会不断弹出。通过命令./start-all.sh启动Hadoop后,立即收到错误消息:

localhost:rajneeshsahai @ localhost:权限被拒绝 (公钥,密码,键盘交互式)

错误日志:

Starting namenodes on [localhost]
localhost: rajneeshsahai@localhost: Permission denied (publickey,password,keyboard-interactive).

Starting datanodes
localhost: rajneeshsahai@localhost: Permission denied (publickey,password,keyboard-interactive).

Starting secondary namenodes [MacBook-Air.local]
MacBook-Air.local: rajneeshsahai@macbook-air.local: Permission denied (publickey,password,keyboard-interactive).

2020-05-29 18:42:06,106 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

Starting resourcemanager
resourcemanager is running as process 2937.  Stop it first.

Starting nodemanagers
localhost: rajneeshsahai@localhost: Permission denied (publickey,password,keyboard-interactive).

我已经尝试了以下操作:

  1. ssh-keygen -t rsa

    cat ~/.ssh/id-rsa.pub >> ~/.ssh/authorized_keys

    chmod 600 ~/.ssh/authorized_keys

    我认为重复此过程已经在系统中创建了多个密钥。

  2. sudo passwd

  3. 已配置/etc/ssh/sshd_config

    (i)将PermitRootLogin prohibit-password更改为PermitRootLogin yes

    (ii)将PasswordAuthentication no更改为PasswordAuthentication yes

    我确实有一个疑问:我是否必须从行中删除哈希标签(#)?

我正在使用macOS Catalina。

2 个答案:

答案 0 :(得分:0)

您可以尝试以下操作:

$ ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ chmod 0600 ~/.ssh/authorized_keys

答案 1 :(得分:0)

在 Windows WSL2 Ubuntu 容器上,您必须重新启动 ssh 服务才能使其可用于 Hadoop。您可以尝试在 docker 容器中运行 Hadoop。见https://github.com/big-data-europe/docker-hadoop

每次在 Ubuntu 20.04 容器中启动 Hadoop 之前,我都会重新启动 ssh 服务。

sudo service ssh restart

有关详细信息,请参阅以下教程 https://dev.to/samujjwaal/hadoop-installation-on-windows-10-using-wsl-2ck1