Добавление пути к ssh файлу ключей

Я хочу для создания его так, чтобы то, когда файл ищет ключ ssh/Users/skline/.ssh/id_rsa.pub это автоматически также, изучило каталог,/var/root/.ssh/id_rsa.pub (где мой ssh на самом деле расположен.), Как я делаю это на OSX? Я плохо знаком с терминалом, так спасибо :)

1
задан 21.02.2011, 01:22

1 ответ

Если что-либо как SSH, который я использую, то необходимо смочь использовать '-i' опция.

например, ssh размещают-i/var/root/.ssh/id_rsa

Из страницы справочника:

 -i identity_file
     Selects a file from which the identity (private key) for RSA or
     DSA authentication is read.  The default is ~/.ssh/identity for
     protocol version 1, and ~/.ssh/id_rsa and ~/.ssh/id_dsa for pro-
     tocol version 2.  Identity files may also be specified on a per-
     host basis in the configuration file.  It is possible to have
     multiple -i options (and multiple identities specified in config-
     uration files).

Или для постоянного решения, добавьте следующую опцию (с путем) к Вашему ~/.ssh/config

 IdentityFile /var/root/.ssh/id_rsa

И снова, соответствующая запись страницы справочника:

 IdentityFile
         Specifies a file from which the user's DSA, ECDSA or DSA
         authentication identity is read.  The default is ~/.ssh/identity
         for protocol version 1, and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa and
         ~/.ssh/id_rsa for protocol version 2.  Additionally, any
         identities represented by the authentication agent will be used
         for authentication.  ssh(1) will try to load certificate
         information from the filename obtained by appending -cert.pub to
         the path of a specified IdentityFile.

         The file name may use the tilde syntax to refer to a user's home
         directory or one of the following escape characters: `%d' (local
         user's home directory), `%u' (local user name), `%l' (local host
         name), `%h' (remote host name) or `%r' (remote user name).

         It is possible to have multiple identity files specified in
         configuration files; all these identities will be tried in
         sequence.
3
ответ дан 12.12.2019, 10:35

Теги

Похожие вопросы