Tips for finding Knowledge Articles

  • - Enter just a few key words related to your question or problem
  • - Add Key words to refine your search as necessary
  • - Do not use punctuation
  • - Search is not case sensitive
  • - Avoid non-descriptive filler words like "how", "the", "what", etc.
  • - If you do not find what you are looking for the first time,reduce the number of key words you enter and try searching again.
  • - Minimum supported Internet Explorer version is IE9
Home  >

KB-0277: Using Public Key Authentication with Centrify OpenSSH

Authentication Service ,  

12 April,16 at 11:12 AM


How to enable Centrify OpenSSH to work with public key authentication?


If you want to enable Centrify's distribution of OpenSSH to work with public key authentication between two Unix hosts, the following procedure will help you enable that capability:

1) Uncomment the following lines in /etc/centrifydc/ssh/sshd_config: #PubkeyAuthentication yes #AuthorizedKeysFile .ssh/authorized_keys

2) On the SSH client:

a) Make sure your .ssh directory permissions are 700: chmod 700 ~/.ssh
b) Generate the key: ssh-keygen -q -f ~/.ssh/id_rsa -t rsa [You can use a passphrase or not. If you use one (recommended), you'll be prompted for it whenever you ssh with the public key.]
c) You may want to lock down the file permissions at this point: $ chmod go-w ~/ $ chmod 700 ~/.ssh $ chmod go-rwx ~/.ssh/*

3) Then, copy the public portion of the key to the server you want to ssh to: scp ~/.ssh/ (note that the : at the end should be included in the syntax)

4) On the server:
a) change the directory permissions: $ chmod 700 ~/.ssh
b) put the keypair into the authorized_keys file: $ cat ~/ >> ~/.ssh/authorized_keys
c) change the file permissions of the authorized_keys file: $ chmod 600 ~/.ssh/authorized_keys
d) remove the old public key file: $ rm ~/ ....This should allow you to do public key ssh. You will need to uncomment those lines in /etc/centrifydc/ssh/sshd_config for any machine you use as an ssh client for this purpose.

To test, if you opted to use a passphrase, when you ssh to the server, it should prompt you for the public key passphrase now.