Skip to main content
Applied syntax highlighting ; Added correct markdown for monospaced code ; Grammatical corrections (incl. formatting)
Source Link
JW0914
  • 8.3k
  • 7
  • 31
  • 50

SSH can't find id_rsa and id_rsa.pub files on windowsWindows 10

I have a file runme.cmd containing the following lines:

pushd %~dp0
set home=%CD:~0,2%\Batch\mySSH
%home%\ssh -v -o LogLevel=Verbose [email protected] "do something"
popd

This file (runme.cmd) is located in the folder K:\Batch\mySSH

Furthermore, the files id_rsaid_rsa and id_rsa.pubid_rsa.pub are located in K:\Batch\mySSH\.ssh

When running runme.cmdK:\Batch\mySSH, I seewith script K:\Batch\mySSH\runme.cmd being called from Excel (via VBA), containing the following:

OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2
debug1: Connecting to 11.111.111.11 [11.111.111.11] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\johnDoe/.ssh/id_rsa type -1
...
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: C:\\Users\\johnDoe/.ssh/id_rsa
...
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Users\\johnDoe/.ssh/id_rsa
pushd %~dp0
  set home=%CD:~0,2%\Batch\mySSH
  %home%\ssh -v -o LogLevel=Verbose [email protected] "do something"
popd
  • runme.cmd output:
    OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2
    
    debug1: Connecting to 11.111.111.11 [11.111.111.11] port 22.
    debug1: Connection established.
    debug1: identity file C:\\Users\\johnDoe/.ssh/id_rsa type -1
    ...
    debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
    debug1: Will attempt key: C:\\Users\\johnDoe/.ssh/id_rsa
    ...
    debug1: Next authentication method: publickey
    debug1: Trying private key: C:\\Users\\johnDoe/.ssh/id_rsa
    

Instead of targeting C:\Users\johnDoe\.ssh , howHow do I ensure it looks for the id_rsa files in the folder K:\Batch\mySSH\.ssh ?

If of any importance, this is run on Windows 10 64-bitK:\Batch\mySSH\.ssh\id_rsa, and the file runme.cmd is called from Excelinstead of targeting (via VBA).C:\Users\johnDoe\.ssh?

SSH can't find id_rsa and id_rsa.pub files on windows 10

I have a file runme.cmd containing the following lines:

pushd %~dp0
set home=%CD:~0,2%\Batch\mySSH
%home%\ssh -v -o LogLevel=Verbose [email protected] "do something"
popd

This file (runme.cmd) is located in the folder K:\Batch\mySSH

Furthermore, the files id_rsa and id_rsa.pub are located in K:\Batch\mySSH\.ssh

When running runme.cmd, I see the following:

OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2
debug1: Connecting to 11.111.111.11 [11.111.111.11] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\johnDoe/.ssh/id_rsa type -1
...
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: C:\\Users\\johnDoe/.ssh/id_rsa
...
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Users\\johnDoe/.ssh/id_rsa

Instead of targeting C:\Users\johnDoe\.ssh , how do I ensure it looks for the id_rsa files in the folder K:\Batch\mySSH\.ssh ?

If of any importance, this is run on Windows 10 64-bit, and the file runme.cmd is called from Excel (via VBA).

SSH can't find id_rsa and id_rsa.pub files on Windows 10

id_rsa and id_rsa.pub are located in K:\Batch\mySSH, with script K:\Batch\mySSH\runme.cmd being called from Excel (via VBA), containing the following:

pushd %~dp0
  set home=%CD:~0,2%\Batch\mySSH
  %home%\ssh -v -o LogLevel=Verbose [email protected] "do something"
popd
  • runme.cmd output:
    OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2
    
    debug1: Connecting to 11.111.111.11 [11.111.111.11] port 22.
    debug1: Connection established.
    debug1: identity file C:\\Users\\johnDoe/.ssh/id_rsa type -1
    ...
    debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
    debug1: Will attempt key: C:\\Users\\johnDoe/.ssh/id_rsa
    ...
    debug1: Next authentication method: publickey
    debug1: Trying private key: C:\\Users\\johnDoe/.ssh/id_rsa
    

How do I ensure it looks for K:\Batch\mySSH\.ssh\id_rsa, instead of targeting C:\Users\johnDoe\.ssh?

Post Closed as "Duplicate" by Mokubai
added 3 characters in body
Source Link

I have a file runme.cmd containing the following lines:

pushd %~dp0
set home=%CD:~0,2%\Batch\mySSH
%home%\ssh -v -o LogLevel=Verbose [email protected] "do something"
popd

This file (runme.cmd) is located in the folder K:\Batch\mySSH

Furthermore, the files id_rsa and id_rsa.pub are located in K:\Batch\mySSH\Batch\mySSH\.ssh

When running runme.cmd, I see the following:

OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2
debug1: Connecting to 11.111.111.11 [11.111.111.11] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\johnDoe/.ssh/id_rsa type -1
...
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: C:\\Users\\johnDoe/.ssh/id_rsa
...
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Users\\johnDoe/.ssh/id_rsa

Instead of targeting C:\Users\johnDoe\Users\johnDoe\.ssh , how do I ensure it looks for the id_rsa files in the folder K:\Batch\mySSH\Batch\mySSH\.ssh ?

If of any importance, this is run on Windows 10 64-bit, and the file runme.cmd is called from Excel (via VBA).

I have a file runme.cmd containing the following lines:

pushd %~dp0
set home=%CD:~0,2%\Batch\mySSH
%home%\ssh -v -o LogLevel=Verbose [email protected] "do something"
popd

This file (runme.cmd) is located in the folder K:\Batch\mySSH

Furthermore, the files id_rsa and id_rsa.pub are located in K:\Batch\mySSH.ssh

When running runme.cmd, I see the following:

OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2
debug1: Connecting to 11.111.111.11 [11.111.111.11] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\johnDoe/.ssh/id_rsa type -1
...
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: C:\\Users\\johnDoe/.ssh/id_rsa
...
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Users\\johnDoe/.ssh/id_rsa

Instead of targeting C:\Users\johnDoe.ssh , how do I ensure it looks for the id_rsa files in the folder K:\Batch\mySSH.ssh ?

If of any importance, this is run on Windows 10 64-bit, and the file runme.cmd is called from Excel (via VBA).

I have a file runme.cmd containing the following lines:

pushd %~dp0
set home=%CD:~0,2%\Batch\mySSH
%home%\ssh -v -o LogLevel=Verbose [email protected] "do something"
popd

This file (runme.cmd) is located in the folder K:\Batch\mySSH

Furthermore, the files id_rsa and id_rsa.pub are located in K:\Batch\mySSH\.ssh

When running runme.cmd, I see the following:

OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2
debug1: Connecting to 11.111.111.11 [11.111.111.11] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\johnDoe/.ssh/id_rsa type -1
...
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: C:\\Users\\johnDoe/.ssh/id_rsa
...
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Users\\johnDoe/.ssh/id_rsa

Instead of targeting C:\Users\johnDoe\.ssh , how do I ensure it looks for the id_rsa files in the folder K:\Batch\mySSH\.ssh ?

If of any importance, this is run on Windows 10 64-bit, and the file runme.cmd is called from Excel (via VBA).

Source Link

SSH can't find id_rsa and id_rsa.pub files on windows 10

I have a file runme.cmd containing the following lines:

pushd %~dp0
set home=%CD:~0,2%\Batch\mySSH
%home%\ssh -v -o LogLevel=Verbose [email protected] "do something"
popd

This file (runme.cmd) is located in the folder K:\Batch\mySSH

Furthermore, the files id_rsa and id_rsa.pub are located in K:\Batch\mySSH.ssh

When running runme.cmd, I see the following:

OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2
debug1: Connecting to 11.111.111.11 [11.111.111.11] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\johnDoe/.ssh/id_rsa type -1
...
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: C:\\Users\\johnDoe/.ssh/id_rsa
...
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Users\\johnDoe/.ssh/id_rsa

Instead of targeting C:\Users\johnDoe.ssh , how do I ensure it looks for the id_rsa files in the folder K:\Batch\mySSH.ssh ?

If of any importance, this is run on Windows 10 64-bit, and the file runme.cmd is called from Excel (via VBA).