O'Reilly logo

Linux Shell Scripting Cookbook by Sarath Lakshman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Password-less auto-login with SSH

SSH is widely used with automation scripting. By using SSH, it is possible to remotely execute commands at remote hosts and read their output. SSH is authenticated by using username and password. Passwords are prompted during the execution of SSH commands. But in automation scripts, SSH commands may be executed hundreds of times in a loop and hence providing passwords each time is impractical. Hence we need to automate logins. SSH has a built-in feature by which SSH can auto-login using SSH keys. This recipe describes how to create SSH keys and facilitate auto-login.

How to do it...

The SSH uses public key-based and private key-based encryption techniques for automatic authentication. An authentication key has two ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required