
SSH installation and configuration
One of the prerequisites to run Hadoop is to install ssh. Hadoop scripts requires sshd to be running to manage Hadoop remote daemons. To install it in Ubuntu, use the following command:
$ sudo apt-get install ssh
$ sudo apt-get install rsync
SSH, also known as Secure Socket Shell or Secure Shell, is a cryptographic protocol that helps to encrypt communication in unsecured networks where an SSHD is the daemon program for SSH. Together they provide secure communication between two untrusted hosts over an insecure network.
Once the installation completes after executing the preceding commands, it's time to configure your SSH services. The first step is to generate an SSH key for our user by executing the following command:
$ ssh-keygen -t rsa -P ""
-t is the type of key and -P implies for the password. It is left blank so that Hadoop can interact with its nodes with any user involvement. Otherwise every time Hadoop requires any communication with its nodes, the user has to enter a passphrase to continue the operation. The output of the preceding program is shown in the following screenshot:

Figure-2.4.2
The next step is to enable SSH access locally using the previously generated keys. For this purpose, execute the following command:
$ cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
It's time to test our configuration. User interaction is required only for the first time, to accept the connection and add a host key fingerprint to the user's known_hosts file. Execute the following command to connect to your local machine using SSH without any user involvement:
$ ssh localhost
The output of the command is as follows:

Figure-2.4.3