Ssh Agent Forwarding: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 13: Line 13:


Agent forwarding means using the local identity (private key) from the machine that initiated the ssh connection on the remote machine - the machine you're logging into. This mode allows you to authenticate against further machines you may log into, with your local credentials, while logged in on the remote machine, without copying your private key on the remote machine.  
Agent forwarding means using the local identity (private key) from the machine that initiated the ssh connection on the remote machine - the machine you're logging into. This mode allows you to authenticate against further machines you may log into, with your local credentials, while logged in on the remote machine, without copying your private key on the remote machine.  
To use it, first you need to add the private key identity you want to use to the authentication agent:
ssh-add ~/.ssh/id_rsa
Then you connect with using the -A option:


  ssh -A ...
  ssh -A ...


This forwards the connection to your [[OpenSSH_Concepts#ssh_Agent|ssh agent]] on the remote computer.
This forwards the connection to your [[OpenSSH_Concepts#ssh_Agent|ssh agent]] on the remote computer.

Revision as of 17:30, 9 August 2019

External

Internal

Overview

Agent forwarding means using the local identity (private key) from the machine that initiated the ssh connection on the remote machine - the machine you're logging into. This mode allows you to authenticate against further machines you may log into, with your local credentials, while logged in on the remote machine, without copying your private key on the remote machine.

To use it, first you need to add the private key identity you want to use to the authentication agent:

ssh-add ~/.ssh/id_rsa

Then you connect with using the -A option:

ssh -A ...

This forwards the connection to your ssh agent on the remote computer.