ssh-fob | SSH private keys on a USB keychain | SSH Utils library
kandi X-RAY | ssh-fob Summary
kandi X-RAY | ssh-fob Summary
Keep your SSH private keys on a USB keychain; use a script to initialize a self-destructing ssh-agent instance
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ssh-fob
ssh-fob Key Features
ssh-fob Examples and Code Snippets
Community Discussions
Trending Discussions on ssh-fob
QUESTION
Use case: I have a Jenkins pipeline to update my development environment. My dev env is an EC2 aws instance with docker compose.
The automation was written along the lines of:
...ANSWER
Answered 2018-Sep-12 at 16:31First some background to understand the reasoning (this is pure ssh, no Jenkins or Mercurial specific): the ssh-agent
utility works by making a UNIX domain socket to be then used by ssh
. The ssh
command attempts to communicate with the agent if it finds the the environment variable SSH_AUTH_SOCK
. In addition, ssh
can be instructed to forward the agent, via -A
. For more details, see the man pages of ssh-agent
and ssh
.
So, assuming that your withAWS
context makes the environment variable SSH_AUTH_SOCK
(set by the plugin) available, I think it should be enough to:
- add
-A
to yourssh
invocation - in the part
'run some command like docker pull'
, add thehg clone
command, ensuring you are using thessh://
schema for the mercurial URL.
Security observation: -o StrictHostKeyChecking=no
should be used as a last resort. From your example, the IP address of the target is fixed, so you should do the following:
- remove the
-o StrictHostKeyChecking=no
- one-shot: get the host fingerprint of
123.456.789
(for example by ssh-ing into it and then looking for the associated line in your$HOME/.known_hosts
). Save that line in a file, say123.456.789.fingerpint
- make the file
123.456.789.fingerprint
available to Jenkins when it is invoking your sample code. This can be done by committing that file in the repo that contains the Jenkins pipeline, it is safe to do so since it doesn't contain secrets. - Finally, change your ssh invocation to something like
ssh -o UserKnownHostsFile=/path/to/123.456.789.fingerprint ...
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ssh-fob
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page