SSH Password-less login

作者:Rui 发布时间:September 9, 2015 分类:Linux,CLOUD 浏览:709

工作中有管理多台Linux主机,经常SSH远程登录其他主机,每次输入密码比较麻烦,SSH Password-less login 是解决这个问题比较好的方法之一。该文章记录一下SSH Password-less login 的具体使用步骤。

####设置环境

SSH client : 10.147.15.71
SSH Remote Login Server: 10.147.6.205

该示例中,我们要设置从 IP 71的服务器SSH 自动登录205的服务器

Step 1: 创建 Authentication SSH-Kegen Keys – (10.147.15.71)

# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/xp017734/.ssh/id_rsa): [Press enter key]
Created directory '/home/xp017734/.ssh'.
Enter passphrase (empty for no passphrase): [Press enter key]
Enter same passphrase again: [Press enter key]
Your identification has been saved in /home/xp017734/.ssh/id_rsa.
Your public key has been saved in /home/xp017734/.ssh/id_rsa.pub.
The key fingerprint is:
5f:ad:40:00:8a:d1:9b:99:b3:b0:f8:08:99:c3:ed:d3 xp017734@cbjlx9438
The key's randomart image is:
+--[ RSA 2048]----+
|        ..oooE.++|
|         o. o.o  |
|          ..   . |
|         o  . . o|
|        S .  . + |
|       . .    . o|
|      . o o    ..|
|       + +       |
|        +.       |
+-----------------+

阅读剩余部分...

如何在 Ubuntu上配置伪分布式Hadoop

作者:Rui 发布时间:August 28, 2015 分类:JAVA,Linux,BIGDATA 浏览:559

环境

  1. Ubuntu 12.04 TLS
  2. Oracle JDK 1.8
  3. Hadoop2.6.4

创建用户并设置SSH

创建用户

sudo useradd -m hadoop -s /bin/bash
sudo passwd hadoop 
sudo adduser hadoop sudo
sudo su - hadoop

SSH Password-less login setting

cd ~/.ssh/                     
ssh-keygen -t rsa             
cat ./id_rsa.pub >> ./authorized_keys  

环境变量设置

解压 Hadoop2.6.4 并将Hadoop-2.6.4 放到 /home/hadoop.

vim ~/.bashrc

在此文件中添加一下变量

export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export HADOOP_HOME=/home/hadoop/hadoop-2.6.4
export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin

阅读剩余部分...