Server Fault is a question and answer site for system and network administrators. 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

My Uni's all ssh keys were stolen. The Sys admins decided to remove all .ssh folders and move the files to a folder which name I cannot say.

I am interested how the sysadmins changed the default SSH-key folder.

How can you change the default ~/.ssh -folder to the folder ~/TopSecret/, such that my computer detects that the keys are in a new folder?

share|improve this question
up vote 9 down vote accepted

Have a look at sshd_config(5) and edit /etc/ssh/sshd_config. Note that the path of relevant configuration files is set for each file individually (that is, it's not a matter of just changing the string .ssh to something else in one place in the config file).

Anyway, the setting you're looking for is AuthorizedKeysFile.

share|improve this answer
From the openssh sshd_config man pages: AuthorizedKeysFile. Specifies the file that contains the public keys that can be used for user authentication. AuthorizedKeysFile may contain tokens of the form %T which are substituted during connection setup. The following tokens are defined: %% is replaced by a literal '%', %h is replaced by the home directory of the user being authenticated, and %u is replaced by the username of that user. After expansion, AuthorizedKeysFile is taken to be an absolute path or one relative to the user's home directory. The default is ``.ssh/authorized_keys''. – samt May 25 '09 at 23:20

To reduce the impact of private key disclosure, it's advisable to password encrypt the key itself. Offline brute force attacks on specific keys are still possible, but it does throw a wrench in someone who makes off with a cartload of user keys.

More to the point, you shouldn't store private keys of value on anything you don't control. To connect to a server, storing the public key on the server is sufficient.

share|improve this answer

You can rename folders with the "mv" command. So you could rename TopSecret back to .ssh by "mv TopSecret .ssh".

The administrators can control where the sshd looks for your keys by changing the /etc/ssh/sshd_config file's AuthorizedKeysFile parameter. You can't change this.

share|improve this answer
Thank you for your answer! – Masi May 21 '09 at 22:13

Your Answer


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.