Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

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?


share|improve this question

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

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

You've two options:

  • fix the permissions (chmod 600 some_file.ppk && ssh-add some_file.ppk)
  • add the key via the standard input (ssh-add - <some_file.ppk)
share|improve this answer

You must log in to answer this question.

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