0

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.

8
  • 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. Oct 3, 2015 at 21:25
  • use can use ssh-keygen in cygwin to make a key. BTW I like how you used the same port number for your port forwarding, for seamlessness. and with 127.0.0.1/localhost means it's ssh all the way
    – barlop
    Oct 3, 2015 at 21:29
  • A passphrase is not a password, it should be longer and less easy to guess than a password, as it can be brute forced, and your passwords should be better than they, probably are. If the enemy get hold of your computer, then they will try to break into your key-file, so that they can then break in to that DoD computer in ohio. Consider using ssh-add, so that you can use a longer passphrase, without the inconvenience. Oct 3, 2015 at 21:29
  • @richard technically a password is not necessarily easier to break than a key, e.g. if a password is as long and random looking as a key, then it'd be just as "impossible"/"possible" to brute force as a key, though indeed, in practice, people don't use passwords as long and random looking as keys. Though they could if they use a program to store their passwords, or a usb rubber ducky like gadget that types in the passwords automatically.
    – barlop
    Oct 3, 2015 at 21:34
  • @barlop yep, turns out I needed a .pem file instead of a .ppk. Tunnel vision. The ports are for Postgres, so I can use pgAdmin, thanks.
    – rshaq
    Oct 3, 2015 at 21:37

2 Answers 2

2

ppk file format is specific to PuTTY. I think you need to convert it to a general format. You can use puttegen.exe to do this.

1
  • Of course! I knew it was something silly that could have been seen had I slept in the past 24 hours. Thanks!
    – rshaq
    Oct 3, 2015 at 21:34
0

With cygwin, you could use ssh-keygen to make a key

And you could use 'cat' and maybe the 'file' command, to look at the key and check the format too. Apparently there are a load of key formats.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .