搭建hadoop集群的时候一定会用到的就是SSH免密码登录

[hadoop@hadoop1 ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hadoop/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/hadoop/.ssh/id_rsa.
Your public key has been saved in /home/hadoop/.ssh/id_rsa.pub.
The key fingerprint is:
::da:::3d::::bf:eb::d1::d9: hadoop@hadoop1
The key's randomart image is:
+--[ RSA ]----+
| ..+ + |
| o . o E . |
| o . + |
| o . .o . |
| o o + S o |
| . . * + .. |
| o o .. |
| .. |
| .. |
+-----------------+
[hadoop@hadoop1 ~]$ cd .ssh
[hadoop@hadoop1 .ssh]$ scp -r id_rsa.pub hadoop@hadoop3:/home/hadoop/.ssh/authorized_keys
The authenticity of host 'hadoop3 (192.168.127.120)' can't be established.
RSA key fingerprint is :be:af::::6d::7e:dd::fa::b3::2f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'hadoop3,192.168.127.120' (RSA) to the list of known hosts.
hadoop@hadoop3's password:
id_rsa.pub % .4KB/s :
[hadoop@hadoop1 .ssh]$ ssh hadoop3
Last login: Sat Aug :: from hadoop1

如果不能没有成功

方法一:

[hadoop@hadoop3 ~]$ chmod  .ssh/
[hadoop@hadoop3 ~]$ cd .ssh
[hadoop@hadoop3 .ssh]$ chmod authorized_keys

方法二:

[root@hadoop3 .ssh]# vi /etc/ssh/sshd_config
AuthorizedKeysFile .ssh/authorized_keys 把前面的#号去掉
[root@hadoop3 .ssh]# /etc/rc.d/init.d/sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]

Linux下SSH免密码登录(转)的更多相关文章

  1. Linux下SSH免密码登录

    转自:http://haitao.iteye.com/blog/1744272 ssh配置 主机A:10.0.5.199 主机B:10.0.5.198 需要配置主机A无密码登录主机A,主机B 先确保所 ...

  2. Mac下到Linux主机ssh免密码登录

    最近忙得忘乎所以,写篇博客放松放松,RT,直接上命令好了 # Local ssh-keygen -t rsa scp ~/.ssh/id_rsa.pub username@server:~/.ssh/ ...

  3. linux实现ssh免密码登录

    linux实现ssh免密码登录 本地系统执行 ssh-keygen -t rsa 命令,生成密钥文件 在相应的目录下查看生成的密钥文件,其中:id_rsa为私钥文件,id_rsa.pub为公钥文件 本 ...

  4. Linux 配置ssh 免密码登录

    在平常应用中,我们经常会登录到其他主机,比如说服务器,每次都需要用户名和密码. 我们可以通过ssh免密码登录服务器而不需要输入密码. 现在有一台ubuntu的阿里云服务器,称之为 server.  公 ...

  5. jenkins发布项目到远程主机上,配置linux使用SSH免密码登录

    一.首先要配置两台linux如何使用SSH免密码登录,这样脚本执行scp命令以及远程执行脚本都不需要输入密码: A为本地主机(即用于控制其他主机的机器,jenkins服务器) ; B为远程主机(即被控 ...

  6. linux 配置ssh免密码登录

    1.确保主机名唯一 主机名修改方法: a.修改/etc/sysconfig/network,HOSTNAME=想要设置的主机名称 b.修改/etc/hosts,127.0.0.1   localhos ...

  7. Hadoop分布式模式下SSH免密码登录

    1.Hadoop中为什么要配置免密码登录 最近在学习Hadoop,在集群中,Hadoop控制脚本依赖SSH来执行针对整个集群的操作.例如,某个脚本能够终止并重启集群中的所有守护进程.所以,需要安装SS ...

  8. Linux配置SSH免密码登录

    CentOS配置SSH免密码登录为例说明:SSH远程登录的安全外壳协议有两种身份认证机制: - 用户名+密码 -密钥登录 环境准备 host1:192.168.0.10host2:192.168.0. ...

  9. SSH配置—Linux下实现免密码登录

    首先,假设我们有两台服务器,服务器名称分别是 master 和 slave1,我们现在需要做的就是在服务器 master 上面登录 服务器 slave1 不需要输入密码就可以登录成功,如下图所示. 下 ...

随机推荐

  1. php 安装 Redis 扩展

    开发环境安装包为:wamp3.1.0,安装成功后 wamp/bin 目录下有php以下几个版本: 这里以php7.1.9为例进行redis扩展安装,其他php版本也是一样的. 进行安装 step 1: ...

  2. MYSQL学习笔记 (二)对数据库结构的增删改查

    显示数据库 show databases; 选择数据库 use database;//其实database为数据库的名字 创建表 create table tbclass( id int not nu ...

  3. 阻止a标签跳转

       一.在html中 1. <a href="javascript:;"></a> 2. <a href="###">&l ...

  4. 28个Java常用的工具类

    源码下载:http://pan.baidu.com/s/1pJLSczD Base64.javaBase64DecodingException.javaCConst.javaCharTools.jav ...

  5. 源码管理--llorch的Visual Studio基本教程(四)

    通用的演示样例说明: 本系列博客仅仅讨论工具的基础,不讨论不论什么语言. 甚至不讨论快捷键:-) 能够用鼠标就完毕本教程 IDE默认指代的是Visual Studio 2013 Community E ...

  6. Android Studio Beat版公布!

    Android Studio Beat版公布了! 速度比0.61快爆了,有木有! L也能更新了,炫爆了,有木有!

  7. WPF支持GIF的各种方法

    2012.12.18更新:修复下载链接 已知WPF的Image元素只能显示GIF图片的第一帧,而MediaElement不能加载作为资源或内嵌的资源的GIF图片,所以网上有几种实现方法. 我抄袭网上提 ...

  8. Linux系统中/dev/mtd与/dev/mtdblock的区别,即MTD字符设备和块设备的区别

    转:http://www.crifan.com/linux_system_in__dev__mtd_and__dev__mtdblock_distinction_character_devices_a ...

  9. C语言跟内存分配方式-alloc malloc calloc

    转载:http://blog.csdn.net/ubuntulover/article/details/7581317 (1) 从静态存储区域分配.内存在程序编译的时候就已经分配好,这块内存在程序的整 ...

  10. Netty框架

    Netty框架新版本号:3.0.2.GA,于2008年11月19日公布.Netty项目致力于提供一个异步的.事件驱动的网络应用框架和工具,用于高速开发可维护的.高性能的.高扩展性的server和cli ...