I am trying to SSH into a server, where I do not have root privileges. I don't like using Putty, I prefer Cygwin. I can log into the server using Putty, but using the exact same private key and typing in the exact same password, I get an error using Cygwin. I tried this with and without the SSH version 2 force, and with and without the port forwarding option. Same result. Also tried deleting the host from my known_hosts file, same result.
See below. Changed IP address for security.
$ ssh -v -2 -i private_key.ppk -L 5432:localhost:5432 [email protected]
Connecting to 22.22.22.22
OpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015
debug1: Connecting to 22.22.22.22 [22.22.22.22] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/private_key.ppk type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/private_key.ppk-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to 22.22.22.22:22 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:T1wfSekfyPulNsBaGn/d5ubEKy1VKWKmBcr/SQQTRSs
debug1: Host '22.22.22.22' is known and matches the ECDSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:58
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
debug1: Next authentication method: publickey
debug1: Trying private key: /home/user/.ssh/private_key.ppk
Enter passphrase for key '/home/user/.ssh/private_key.ppk':
Enter passphrase for key '/home/user/.ssh/private_key.ppk':
Enter passphrase for key '/home/user/.ssh/private_key.ppk':
debug1: No more authentication methods to try.
Permission denied (publickey).
The "debug1: key_load_public: No such file or directory" part might be it. But again, I can SSH into this server with Putty using the same private key, so my key on the server must be in place.
Permission denied (publickey)
therefore it is the key. The preceding lines look like you had trouble entering the passphrase to unlock the keyfile, this is not the password of the remote machine.