title: using ssh keys with scp and ssh
body: <p>I am trying to copy few files to a target system using scp and then login to the system and install those files. I used scp and ssh commands here with ssh keys for passwordless authentication.</p>
  
  <p>The ssh key was created on the source system as below. Is this the correct and secured way of creating an ssh key?</p>
  
  <pre><code>~]# ssh-keygen -t rsa -N "" -f ~/.ssh/mytest.key
  </code></pre>
  
  <p>The key was copied from the source to target system with executing below command.</p>
  
  <pre><code>~]# ssh-copy-id -i ~/.ssh/mytest.key 
  </code></pre>
  
  <p>Now, the SSH login works fine without prompting for a password, however the scp is still not working.. it still prompts for a password. Should I specify the key path when using scp? If so how do I specify the keypath along with scp command?</p>
  
  <p>Here is the ssh command used</p>
  
  <pre><code>~]# ssh -i ~/.ssh/mytest.key root@192.168.1.1
  </code></pre>