Passwordless SSH authorization — Cloudera VMware using Windows(PuTTY)
Hi,
Are you looking for the Passwordless SSH solution, to connect Cloudera(Linux) remote server or VMware — Guest OS using SSH authorization from Windows(host OS). PuTTY, is our go to solution.
Tools : PuTTY, PuTTYgen, VMware, Cloudera VM
PuTTY and PuTTYgen
Download 32-bit or 64-bit version based on your operation system version.
Click here : Download PuTTY
Install PuTTY by running putty-****.msi
To open PuTTYgen, go to Windows -> Start Menu -> Find “PuTTY” Directory.
- Open “PuTTYgen”
- Check the parameters with these details:
Type of key to generate = RSA
Number of bits in a generated key = 4096 - Click on “Generate” which generates Private/Public Key
Make random movement on blank area to complete this key generation process quickly.
- Click on “Save Public Key” and save file with Public_key.txt [select All files option while saving file]
- Click on “Save Private Key” and save file as Private_key.ppk [select type .ppk while saving file]
To open PuTTY, go to Windows -> Start Menu -> Find “PuTTY” Directory
- Open “PuTTY”
- Keep PuTTY configuration open,
- Go to VMware (Cloudera) window :
- Open Terminal in Cloudera/Linux OS :
- type command : ifconfig
- copy “inet addr” e.g. 192.168.*.*
- Come back to puTTY Configuration:
- In the sessions section, fill Host Name with “cloudera@<copied inet addr>” with port 22
- Find Auth where we are going to add private key(Private_key.ppk)
- connection option in Left side menu -> SSH -> Auth
- Browse and add Private_key.ppk file
- Go back to Session in Left side menu
- Give name “Cloudera_pwless” in Saved_Sessions then click on Save
- Select “Cloudera_pwless” and click on Load
- Click Open : It will ask for password for cloudera user : Type password : cloudera
- create ~/.ssh directory
> mkdir ~/.ssh - create file with name authorized_keys
> touch ~/.ssh/authorized_keys - open file authorized_keys
now, copy generated public key from PuTTYgen and paste into this file - change permission of .ssh
> chmod 700 ~/.ssh - change permission of ~/.ssh/authorized_keys
> chmod 600 ~/.ssh/authorized_keys - change permission of cloudera user home directory
> chmod 740 ~ - Cheers!, you are ready to work with passwordless authorization. Open Putty -> Select “Cloudera_pwless” Saved Sessions. Click on Open.
Note :
Troubleshoot steps: - If you need to restart sshd servic forcefully
Cloudera Terminal :
> sudo service sshd restart
This my first blog. If you have any suggestion, feel free to send your feedback. I will try to improve my skills.