How do I make a *.ppk file let me into SSH (Ubuntu)

22,898

Solution 1

From the error message, I'd say do chmod 600 some_file.ppk and try again. This sets the permission on the file so that only you can read and write it (0777 means any user on the system can read or write to the file).

As a side note, private keys should always have a password. You'll only be prompted for the password when adding it to the SSH agent.

Solution 2

The .ssh directory needs to be read/writeable/executabe by the owner only:

chmod 700 .ssh

authorized_keys and authorized_keys2 need to be read/writeable by the owner only:

chmod 600 .ssh/authorized_key*

As I don't use Ubuntu I cannot verify that this will work, but that is the required setup for RHEL/CentOS.

Share:
22,898

Related videos on Youtube

kocakmstf
Author by

kocakmstf

Updated on September 17, 2022

Comments

  • kocakmstf
    kocakmstf over 1 year

    I have a *.ppk file given to me so I can SSH into a server.

    I'm using Ubuntu 10.x.

    What commands do I need to run so I have permission to SSH?

    I found something that said to do

    ssh-add some_file.ppk
    

    But then, I got this:

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    Permissions 0777 for 'foofoofoo.ppk' are too open.
    It is recommended that your private key files are NOT accessible by others.
    This private key will be ignored.
    

    How can I change permissions on that file so Ubuntu will ssh-ify my .ppk file?

    Thanks