From fa2208ec261b7b9b6da386cc24e264bba98949a9 Mon Sep 17 00:00:00 2001
From: Michael Blaschek <michael.blaschek@univie.ac.at>
Date: Wed, 5 May 2021 10:36:19 +0200
Subject: [PATCH] Update SSH-VPN-VNC/Questions.md

---
 SSH-VPN-VNC/Questions.md | 31 +++++++++++++++++++++++++++----
 1 file changed, 27 insertions(+), 4 deletions(-)

diff --git a/SSH-VPN-VNC/Questions.md b/SSH-VPN-VNC/Questions.md
index 5796c33..15e137a 100644
--- a/SSH-VPN-VNC/Questions.md
+++ b/SSH-VPN-VNC/Questions.md
@@ -4,7 +4,7 @@ Please feel free to add you questions and anwsers.
 [[_TOC_]]
 
 
-## Q: ssh using key authentication?
+## Q: How to use ssh-key authentication?
  
 In order to connect passwordless to a remote server a key needs to be generated.
 ```
@@ -29,11 +29,34 @@ The key's randomart image is:
 |                 |
 +----[SHA256]-----+
 ```
-It is recommended to use a password to encrpyt the private key `.ssh/id_rsa`. However, this password is then required to login. 
 
-Todo add infos on `ssh-agent`
+It is recommended to use a password to encrpyt the private key `.ssh/id_rsa`. However, this password is then required each time to login. Using an  `ssh-agent` can solve that problem.
 
-# Q: How to transfer files between two VPN networks?
+## Q: How to use an ssh-agent?
+Using an SSH-Agent will make your connection even safer, as your private key is encrypted with a passphrase. To create a ssh-key goto [How to use ssh-key authentication?](#How-to-use-ssh-key-authentication?).
+
+Continue with how to use the ssh-agent:
+```bash
+# Launch the SSH Agent
+eval `ssh-agent`
+# this will add your ssh-keys from ~/.ssh/
+# You will be asked a passphrase if you have one
+# this will add .ssh/id_rsa as default
+ssh-add 
+# or any keyfile you created:
+ssh-add .ssh/secret_key
+# Copy the ssh-key (pub) to the server 
+ssh-copy-id [user]@[server]
+# and connect
+ssh [user]@[server]
+# Kill the agent and all store secure information
+ssh-agent -k
+```
+**Tip: configure your `.ssh/config` file to use the correct key a server. Goto [SSH](SSH.md)**
+
+[Nice summary of how an ssh-agent works](https://smallstep.com/blog/ssh-agent-explained/)
+
+## Q: How to transfer files between two VPN networks?
 
 You should be able to use an SSH tunnel via a gateway server
 
-- 
GitLab