book
Article ID: KB0076543
calendar_today
Updated On:
Description
While trying to setup multi-node clustering, we need to login mulitple times to machines under the cluster remotely. To login remotely, SSH(Secure Socket Shell) is used.
By default, SSH requires a password for authentication on a remote server. This setting needs to be modified to login to the remote host through the SSH protocol, without having to enter SSH password multiple times.
Environment
All Supported Operating systems
Resolution
> Check if SSH is installed on machine with the below command.
# systemctl status sshd
If not installed, follow the below steps to install and configure SSH.
1. To install SSH, enter the below commands on terminal.
On Ubuntu:
#
apt update && apt install openssh-server On RHEL/CentOS: #
yum -y install openssh-server openssh-clients
NOTE: MAC OS has a built-in SSH Client. 2. To start SSH service, type the below command. # systemctl start sshd.service To stop SSH service, use the below command
# systemctl stop sshd.service 3. G
enerate an RSA key pair run the following command on the server1 machine. # ssh-keygen -t rsa Press Enter when prompted to enter the file in which to save the key, and for the pass phrase. Please refer the attached screenshot
4. Once the keys is generated, we need to upload the Public key to the server2 machine. Create the directory ".ssh" on the server2 machine first to achieve the same. On server2 machine. # mkdir -p .ssh 5. To Upload the Public key on the server2 machine, type the below command on server1 machine # cat .ssh/id_rsa.pub | ssh username@Server2machine_host 'cat >> .ssh/authorized_keys' username: Username of the server2 machine for login. Server2machine_host: Server2 machine hostname or IP Address. Please refer the below screenshot for better understanding.
NOTE: Above steps configure passwordless SSH login but only from server1 to server2. To enable passwordless SSH login from either side, append the content of ~/.ssh/id_rsa.pub
to ~/.ssh/authorized_key
in the server1 and also copy its ~/.ssh/id_rsa
to server2 machine at ~/.ssh/id_rsa
:
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys scp /.ssh/id_rsa root@10.97.111.145:/.ssh/id_rsa
Issue/Introduction
The below article describes on how to configure password less Secure Socket Shell(SSH) login for Multinode Clustering