【问题标题】:create a user and set up key based ssh on his own account [closed]创建一个用户并在他自己的帐户上设置基于密钥的 ssh [关闭]
【发布时间】:2016-06-27 23:24:08
【问题描述】:

我正在尝试学习 hadoop,所以我正在学习一个教程,但是我在安装 hadoop 时遇到了问题。

我应该创建一个新用户并使用它设置一个 ssh 密钥(使用 ubuntu)。

su
adduser
passwd
su - hadoop
ssh-keygen -t rsa

当我输入最后一条命令时 O get

Enter file in which to save the key (/home/hadoop/.ssh/id_rsa):

不知道该写什么,只是按回车,我得到了

Could not create directory '/home/hadoop/.ssh': No such file or directory
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
open /home/hadoop/.ssh/id_rsa failed: No such file or directory.
Saving the key failed: /home/hadoop/.ssh/id_rsa.

有人可以帮忙吗。

【问题讨论】:

  • 不是编程问题;尝试超级用户或 unix & linux。

标签: linux ubuntu hadoop ssh


【解决方案1】:

在将文件写入之前创建请求的目录:

mkdir -p /home/hadoop/.ssh/
chmod 700 /home/hadoop/.ssh/

并且还要更改权限,以免对私人数据过于开放。

【讨论】:

  • 感谢您的回答它对我有用知道我有新用户并且我生成了一个 ssh 密钥并且我尝试与 ssh localhost 连接输入密码,hadoop@localhost 的密码:我没有输入任何密码?
  • 我不知道您遵循了哪个教程,也不知道这个问题中的这些信息的错误在哪里。但是整理一下并提出另一个问题(而不是关于超级用户)可能是最好的方法。
  • 好的,非常感谢@Jakuje
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-08-04
  • 2016-11-11
  • 1970-01-01
  • 2015-06-28
  • 1970-01-01
  • 2014-03-03
  • 1970-01-01
相关资源
最近更新 更多