<div dir="ltr" style="text-align: justify;" trbidi="on"><b>Enabling Linux Automatic Password-less SSH Login</b></p>
<p>
Automatic passwrod-less ssh login can make our life easier. To enable this, we need to copy our SSH public keys to the remote machines for automatic password-less login. We introduce two methods in this post: using ssh-copy-id command and the manual way.</p>
<p><b>Generate SSH key pair</b></p>
<p>If you do not have a SSH private/public key pair, let’s generate one first.<br />
<i><br />
</i> <i>$ ssh-keygen -t rsa</i></p>
<p>By default on Linux, the key pair is stored in ~/.ssh (id_rsa and id_rsa.pub for private and public key).</p>
<p><b>Copy public SSH key to the remote machine</b></p>
<p>You have two choices here. Unless that you can not use the ssh-copy-id method, you can try the “manual” way.</p>
<p><b>The easiest way</b></p>
<div align='center' id="ads-id"></div>
<p>
Let ssh-copy-id do it automatically:</p>
<p><i>$ ssh-copy-id username@remotemachine</i></p>
<p>If you have multiple keys in your ~/.ssh directory, you may need to use -i key_file to specify which key you will use.</p>
<p><b>The manual way</b></p>
<p>Copy the public SSH key to remote machine</p>
<p><i>$ scp .ssh/id_rsa.pub username@remotemachine:/tmp/</i></p>
<p>Log on the remote machine</p>
<p><i>$ ssh username@remotemachine</i></p>
<p>Append your public SSH key to ~/.ssh/authorized_keys</p>
<p><i>$ cp ~/.ssh/authorized_keys ~/.ssh/authorized_keys.bak # backing up before changing is a good habit</i><br />
<i>$ cat /dev/shm/id_rsa.pub >;>; ~/.ssh/authorized_keys # append pub key to authorized keys list</i></p>
<p>Make sure the mode of ~/.ssh/authorized_keys is 755:</p>
<p><i>$ chmod 755 ~/.ssh/authorized_keys</i></p>
<p><b>Possible Problems</b><br />
<b><br />
</b> <b>Home directory permission</b></p>
<p>Check the home directory’s permission which may cause the key-based login fail (suppose the home directory is /home/zma):</p>
<p><i># chmod 700 /home/zma/</i></p>
</div>
<div class="wp-post-navigation"> 
									 <div class="wp-post-navigation-pre"> 
									 <a href="https://dineshonjava.com/what-is-hdfs/">Previous</a> 
									 </div> 
									 <div class="wp-post-navigation-next"> 
									 <a href="https://dineshonjava.com/hadoop-confiuration/">Next</a> 
									 </div> 
									</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
 $.post('https://dineshonjava.com/wp-admin/admin-ajax.php', {action: 'mts_view_count', id: '181'});
});
</script>
Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…
Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…
Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…
Technology has emerged a lot in the last decade, and now we have artificial intelligence;…
Managing a database is becoming increasingly complex now due to the vast amount of data…
Overview In this article, we will explore Spring Scheduler how we could use it by…