Guys, tell me how to provide cross-authorization by ssh-keys on all four machines? The closed part of the ssh key cannot be stored on the machines. Those. so that you can go through the chain 1st machine -> 2nd machine -> 3rd machine -> 4th machine without entering passwords.

    2 answers 2

    The first machine will have to store the secret part of the key and add it to the ssh-agent :

     $ ssh-add ~/.ssh/id_rsa 

    If you use pytty for logging, then use pagent, and also in the SSH session putty allow the forward agent.

    Add to ~/.ssh/config on all machines:

     Host * ForwardAgent yes 

    or run:

     $ ssh -A user@host 

    The main idea - the key is stored in the agent on the same machine, and all the rest go to this agent for the keys.

      Take the public key from the first machine and add it to ~ / .ssh / authorized_keys in the second machine. Repeat for 2nd and 3rd cars ...