I'm having trouble connecting to a server using public key authentication. OpenSSH on the client computer seems to have a problem finding the private key file. I am able to use the private key file with WinSCP and it works fine.
Below is the directory listing, ssh command, and debug output. Note the 6th debug1:
statement. From what I understand, it's saying it can't find my private key, even though the file name and path are correct (see directory listing). I've tried various types of permissions on the private key file and nothing seems to work. Am I doing something wrong?
Volume in drive C has no label.
Volume Serial Number is D29F-A36F
Directory of C:\openssh
12/13/2015 10:45 AM <DIR> .
12/13/2015 10:45 AM <DIR> ..
12/12/2015 09:20 AM 1,476 prv_key.ppk
11/09/2015 10:17 PM 310 setup-ssh-lsa.cmd
11/09/2015 10:19 PM 699,329 sftp-server.exe
11/09/2015 10:19 PM 776,732 sftp.exe
11/09/2015 10:18 PM 3,165,996 ssh-keygen.exe
11/09/2015 10:18 PM 4,269,803 ssh.exe
11/09/2015 10:18 PM 4,547,092 sshd.exe
11/09/2015 10:17 PM 3,553 sshd_config
12/13/2015 10:31 AM <DIR> x64
12/13/2015 10:31 AM <DIR> x86
8 File(s) 13,464,291 bytes
4 Dir(s) 391,602,634,752 bytes free
C:\openssh>ssh [email protected] -p 1000 -L 2000:192.168.254.120:80 -N -i c:\openssh\prv_key.ppk -v
OpenSSH_7.1p1 Microsoft Win32 port, OpenSSL 1.0.2d 9 Jul 2015
debug1: Connecting to server.net [75.87.138.43] port 1000.
debug1: allocating new sfd, sfd [3] fd [3] handle [440] type [2]
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: allocating new sfd, sfd [4] fd [4] handle [448] type [1]
debug1: key_load_public: No such file or directory
debug1: identity file c:\openssh\prv_key.ppk type -1
debug1: _open() returned error, errno [2]
debug1: key_load_public: No such file or directory
debug1: identity file c:\openssh\prv_key.ppk-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1p1 Microsoft Win32 port Nov 9 2015
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.1
debug1: match: OpenSSH_7.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to server.net:1000 as 'user'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client [email protected] <implicit> none
debug1: kex: client->server [email protected] <implicit> none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:[removed]
debug1: Host '[server.net]:1000' is known and matches the ECDSA host key.
debug1: Found key in C:\Users\me\.ssh\known_hosts:1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: c:\openssh\prv_key.ppk
debug1: allocating new sfd, sfd [4] fd [4] handle [460] type [1]
Enter passphrase for key 'c:\openssh\prv_key.ppk':
debug1: allocating new sfd, sfd [4] fd [4] handle [460] type [1]
Enter passphrase for key 'c:\openssh\prv_key.ppk':
debug1: allocating new sfd, sfd [4] fd [4] handle [460] type [1]
Enter passphrase for key 'c:\openssh\prv_key.ppk':
debug1: allocating new sfd, sfd [4] fd [4] handle [460] type [1]
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: No more authentication methods to try.
Permission denied (publickey,keyboard-interactive).```