Sometimes on Linux cluster, we need to automate work on various nodes, this requires login permission on each node for executing commands. OpenSSH is one of the favorite tools on Linux/ Unix/ Windows based system for remote login.

OpenSSH is the premier connectivity tool for remote login with the SSH protocol. It encrypts all traffic to eliminate eavesdropping, connection hijacking, and other attacks. In addition, OpenSSH provides a large suite of secure tunneling capabilities, several authentication methods, and sophisticated configuration options[*].

Remote operations are done using ssh, scp, and sftp.
Key management with ssh-add, ssh-keysign, ssh-keyscan, and ssh-keygen.
The service side consists of sshd, sftp-server, and ssh-agent.

Creating a password-less login for Linux and Mac OS operating system is almost same.

Open terminal window and type following command:


1. ssh-keygen -t rsa
Press enter for each line 

Screenshot 2017-05-04 16.57.04


2. cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

3. chmod og-wx ~/.ssh/authorized_keys
You can also set permission for authorized_keys as following.
Change the permissions of .ssh to 700
Change the permissions of .ssh/authorized_keys to 640

For the Mac OS, we have to do an additional step as Mac OS by default not enables any remote connection.
open System Preference and click on Sharing icon. Now You have to enable Remote Login checkbox.

Screenshot 2017-05-04 16.08.08

From now on you can log into remote machine without a password.

$ ssh localhost

Posted by:Rahul Kumar

Rahul Kumar working as a Technical lead at Bangalore, India. He has more than 5 years of experience in distributed system design with Java, Scala, Akka toolkit & Play Framework. He developed various real-time data analytics applications using Apache Hadoop, Mesos ecosystem projects, and Apache Spark. He loves to design products around big data and with high velocity streaming data. He had given a couple of talks on Apache Spark, Reactive system and Actor Model in LinuxCon North America, Cassandra summit & Apache Bigdata Summits.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s