Showing posts with label ssh-agent. Show all posts
Showing posts with label ssh-agent. Show all posts

Custom Solution for Managing ssh-agent without Gnome Keyring

Tags: June 14, 2016 8:08 PM
0 comments

Goal

How to enter ssh private key password only once without having managed by Gnome Keyring. The ssh agent should remain detected every time new terminal spawned or even on tty console CTRL+ALT+F1 and so on.

Solutions

We will utilize ssh-add, ssh-agent and little bit shell script commands for achieving the goal.

Step 1

First start the authentication agent and redirect the result to a file so can gather the agent information later.
$ ssh-agent -s > /tmp/my-ssh-agent.sh
Execute the file so we have the correct environment variables needed by ssh-add.

Share on Facebook Twitter

Stop Gnome Keyring for Managing ssh-agent on Xubuntu

Tags: 6:35 PM
0 comments

Goal

Stop Gnome keyring for managing ssh-agent on Ubuntu so you can use the original OpenSSH ssh-agent implementation.

Quick Solution

The solution is quite easy because Gnome Keyring daemon provide a way to replace the existing session.
$ gnome-keyring-daemon --replace --daemonize --components=pkcs11,secrets,gpg
Command above will replace the existing Gnome Keyring daemon but it removes the ability to manage the ssh agent. You can execute command below to make sure Gnome keyring does not manage the ssh agent anymore.

Share on Facebook Twitter

How to Fix Multi-Hop SSH Forward Agent Issue

Tags: April 25, 2016 11:41 AM
0 comments

Problem

You want to connect to the 3rd SSH machine but using the key from the 1st hop not from your local machine. Here is the diagram:
+-----------------------+
|  Local Machine (LM)   |
+-----------------------+
            |
            |
+-------------------------+
|  Remote Machine 1 (RM1) | -> 1st Hop
+--------------------------+
            |
            |
+-------------------------+
|  Remote Machine 2 (RM2) | -> 2nd Hop  
+-------------------------+
            |
            |
+-------------------------+
|  Remote Machine 3 (RM3) | -> 3rd Hop
+-------------------------+
Commands listed below shown what issue we had with the forward agent.
user@local-machine~$ ssh -A remote-machine-1

user@remote-machine-1~$ ssh -A remote-machine-2
(Permission denied)
The authentication was fail because RM2 expect key from RM1 but which ssh agent sent was key from Local Machine.

Share on Facebook Twitter