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

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business. 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.