Je veux faire en sorte que lorsqu'un fichier recherche une clé ssh dans le répertoire /Users/skline/.ssh/id_rsa.pub, il consulte aussi automatiquement le répertoire /var/root/.ssh/id_rsa.pub (où se trouve réellement mon ssh). Je suis nouveau dans le terminal, donc merci :)
Réponse
Trop de publicités?
Pricey
Points
4504
Si cela ressemble au SSH que j'utilise, vous devriez pouvoir utiliser l'option '-i'.
Par exemple ssh host -i /var/root/.ssh/id_rsa
De la page de manuel :
-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).
Ou pour une solution permanente, ajoutez l'option suivante (avec le chemin) à votre ~/.ssh/config
IdentityFile /var/root/.ssh/id_rsa
Et encore une fois, une entrée appropriée dans la page de manuel :
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.