Cant connect to my VPS from Ubuntu Terminal

im try connect to my server using ubuntu terminal

ssh -p 2222 -i mypublickey.ppk username@ip

then its ask “Enter passphrase for key ‘mypublickey.ppk’:”

Im entering my password but its always wrong then i got error Permission denide (publickey).

i have no problem if connect from Putty ubuntu or windows


@kabargamesdotid - To be clear, your ssh session that fails is on the same Ubuntu machine as your PuTTY session which works. Is that correct?

Are you being asked for the passphrase when using PuTTY? If not being asked for the passphrase using PuTTY, is your private key file in PuTTY the same file as ./mypublickey.ppk when you use ssh? (Note: ssh usually uses a ‘.pub’ file and not ‘.ppk’ file)

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others. I need to convert the PPK key to openssh format. sudo apt-get install putty-tools puttygen mypublickey.ppk -O private-openssh -o mypublickey

then connect

From the error message, it sounds like you have a key pair associated with the account you are trying to log in to and the Ubuntu machine you are on. The private key is encrypted with a passphrase, so before it can be used to sign you in, you need to provide the passphrase to decrypt it. This passphrase is different from the password on the server that you are using when logging in with PuTTY.

To force a password-based login, use: ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no

If you don’t remember the passphrase, you’ll need to remove the id_rsa and or id_dsa and files from your ~/.ssh directory on the local machine and/or remove the associated key from the .ssh/authorized_keys file on the server. Once you do that, you’ll default to password-based login.