Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • That doesn't work. It still looks for the file id_rsa in the folder C:\Users\johnDoe\.ssh\ . However, this file is located in K:\Batch\mySSH\.ssh\ Commented Sep 29, 2020 at 9:38
  • Try and use the absolute path to your identity file, you might need to escape spaces with \ if your path contains any. Hopefully this should fix your issue: -i K:\Batch\mySSH\.ssh\id_rsa. Alternatively, consider storing your identity files inside of your user directory, inside of .ssh. This would be better practice than leaving your identity outside of the user protected directory structure.
    – paddywan
    Commented Sep 29, 2020 at 9:42
  • I know that if I store the file in the user folder all works fine. I have tested that already. When using the option -i %home%\.ssh\id_rsa , I'm getting the issue: Permissions for 'K:\\Batch\\mySSH\\.ssh\\id_rsa' are too open. Commented Sep 29, 2020 at 9:51
  • 1
    So the answer works. For the answer to your new problem, see superuser.com/q/1296024/213663 Commented Sep 29, 2020 at 9:55