Assume that you need to establish SSH key for two hosts to crawl, update code, host a:111.111.111.111, host b:222.222.222.222.
First, use two accounts ([email protected] and [email protected]) to generate two ssh, respectively, to a different location, for example:
# Host A's presence/c/user/. ssh/id_rsassh-keygen -t rsa–c "[email protected]" # Host B exists /c/user/. ssh/hostb/id_rsassh-keygen –t rsa–c "[email protected]"/c/user/. ssh/hostb/id_rsa # When a storage location is required, enter
Then, under the/c/user/.ssh/directory, create a file named "config" and enter the following:
111.111. 111.111 111.111. 111.111 preferredauthentications publickey ~/. SSH/222.222. 222.222 222.222. 222.222 preferredauthentications publickey ~/. SSH/hostb/id_rsa
Finally, test it:
SSH 111.111. 111.111 ssh222.222. 222.222
Configuration management multiple SSH keys