Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

4 Answers 4

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.

share|improve this answer

This might help:

http://leadingedgescripts.co.uk/server-administration/how-to-convert-your-putty-ppk-private-key-to-a-normal-ssh-key-you-can-use-on-an-apple-mac/

In short, you need to convert the PPK file (which is a Putty file) into something which can be used by the command line ssh client.

EDIT: Link isn't working

share|improve this answer

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|improve this answer

This will remove all permissions for other users in the file's group and all other users:

$ chmod g=,o= some_file

(Note depending on your system's configuration, you may be the only user in your group, which should be the same group that owns the file.)

View file permissions with ls -l:

$ ls -l some_file
-rw-r--r-- 1 user group 0 2010-7-14 23:29 some_file
$ chown g=,o= some_file
$ ls -l some_file
-rw------- 1 user group 0 2010-7-14 23:29 some_file
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.