hadoop 环境搭建问题

本文介绍了如何使用ssh-keygen命令生成SSH密钥,并解决了密钥权限问题导致的登录失败。通过调整密钥文件的权限为0600,实现了无密码登录。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

创建一个SSH密钥
[root@oplinux ~]# ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
Generating public/private rsa key pair.
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? yes
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
f8:d4:aa:99:55:23:b3:c9:2e:81:ea:03:69:e9:d7:c9 root@oplinux.hehaibo.com
[root@oplinux ~]# cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[root@oplinux ~]# ssh localhost
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#提示不能通过ssh localhost直接登录 权限有问题 把权限降到0600就ok
Permissions 0666 for '/root/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /root/.ssh/id_rsa
Enter passphrase for key '/root/.ssh/id_rsa': 
Last login: Tue Mar  6 19:07:51 2012 from 192.168.91.1
#解决办法 执行如下命令
[root@oplinux ~]# chmod 0600 ~/.ssh/id_rsa
#登陆成功
[root@oplinux ~]# ssh localhost
Last login: Tue Mar  6 19:10:52 2012 from oplinux.hehaibo.com
[root@oplinux ~]# 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值