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
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.
From now on you can log into remote machine without a password.
$ ssh localhost