37
loading...
This website collects cookies to deliver better user experience
sshd
. Whenever you want to use ssh to pull something or access something remotely, it uses an unencrypted version of your ssh keys, so you don't need to type your passphrase every time you need to use ssh command.volume
to the socket using $SSH_AUTH_SOCK
.ssh-add
so it loads your keys into your agent, but ensure that your ssh-agent is up and running.ssh-add -l
, Whenever you want to make your remote host (VPS for example) to access the same thing as you, just add ssh -A ....
and your agent will be forwarded.
When using docker, you can use the $SSH_AUTH_SOCK
as such
version: '3'
services:
app:
container_name: yourcontainer
environment:
- SSH_AUTH_SOCK=/ssh-agent
image: yourapp
volumes:
- ${SSH_AUTH_SOCK}:/ssh-agent
/ssh-agent
ssh -T [email protected]
, they will be authenticated as you.ssh -A
all the time, if your server is compromised, you might allow an attacker to use your ssh-agent socket, so they can literally access your other data which needs ssh, so to use with extreme care.ssh-keygen
is necessary, you don't want to have bare-naked keys dangling if your local pc is compromised, you are screwed.