2012-12-08 16 views

Odpowiedz

8

Można użyć opcji -i.

Źródło: man ssh

-i identity_file 
    Selects a file from which the identity (private key) for public key authentication 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. 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 configuration 
    files). ssh will also try to load certificate information from the filename obtained by appending -cert.pub to identity filenames. 
2

Można również dodać konkretną konfigurację do każdego hosta można uzyskać dostęp, który jest niemal tak samo, jak utrzymująca się korzystanie z flagami dostępnych w ssh.

Dostępny jest cały świat flag i istnieją pewne odwzorowania dla każdej z oferowanych usług. W twoim przypadku, stosując specyficzne id_rsa plików, można zapisać do pliku ~/.ssh/config:

... 

Host host_alias 
    HostName host_name 
    IdentityFile ~/.ssh/id_rsa_you_want 

... 

Następnie można po prostu użyć:

ssh host_alias 

A id_rsa_you_want będą wykorzystywane - jak wszelkie inne konfiguracje, które możesz zastosować do połączenia. Zobacz man ssh_config dla całej listy dostępnych dyrektyw.

Powiązane problemy