<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Web on ctsolakis.com</title><link>https://ctsolakis.com/tags/web/</link><description>Recent content in Web on ctsolakis.com</description><generator>Hugo</generator><language>en-us</language><managingEditor>ctsol001@odu.edu (Christos Tsolakis)</managingEditor><webMaster>ctsol001@odu.edu (Christos Tsolakis)</webMaster><lastBuildDate>Tue, 19 Mar 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://ctsolakis.com/tags/web/index.xml" rel="self" type="application/rss+xml"/><item><title>How about stopping sending your public keys ?</title><link>https://ctsolakis.com/2019/03/19/how-about-stopping-sending-your-public-keys/</link><pubDate>Tue, 19 Mar 2019 00:00:00 +0000</pubDate><author>ctsol001@odu.edu (Christos Tsolakis)</author><guid>https://ctsolakis.com/2019/03/19/how-about-stopping-sending-your-public-keys/</guid><description>&lt;p>Did you know that when connecting to a server wish &lt;code>ssh&lt;/code> it will first send &lt;strong>all&lt;/strong> your public ssh keys and then
it will promt you for a password ? Sure it is just public keys, but still. See here for more &lt;a href="https://github.com/FiloSottile/whosthere">https://github.com/FiloSottile/whosthere&lt;/a>&lt;/p></description></item><item><title>Embracing ssh-agent</title><link>https://ctsolakis.com/2016/11/10/embracing-sshagent/</link><pubDate>Thu, 10 Nov 2016 00:00:00 +0000</pubDate><author>ctsol001@odu.edu (Christos Tsolakis)</author><guid>https://ctsolakis.com/2016/11/10/embracing-sshagent/</guid><description>&lt;p>&lt;code>ssh-agent&lt;/code> helps with managing ssh keys, it can keep track of unlocked
identity ssh keys making possible to enter the passphrase only once
and use the unlocked key for all upcoming ssh connections. You can make it even
more flexible by &lt;a href="https://superuser.com/questions/141044/sharing-the-same-ssh-agent-among-multiple-login-sessions">Sharing the same &lt;code>ssh-agent&lt;/code> among multiple login
sessions&lt;/a>.
Below is the best answer in my opinion, that I have used successfully may times.&lt;/p>
&lt;pre>&lt;code>function sshagent_findsockets {
 find /tmp -uid $(id -u) -type s -name agent.\* 2&amp;gt;/dev/null
}

function sshagent_testsocket {
 if [ ! -x &amp;quot;$(which ssh-add)&amp;quot; ] ; then
 echo &amp;quot;ssh-add is not available; agent testing aborted&amp;quot;
 return 1
 fi

 if [ X&amp;quot;$1&amp;quot; != X ] ; then
 export SSH_AUTH_SOCK=$1
 fi

 if [ X&amp;quot;$SSH_AUTH_SOCK&amp;quot; = X ] ; then
 return 2
 fi

 if [ -S $SSH_AUTH_SOCK ] ; then
 ssh-add -l &amp;gt; /dev/null
 if [ $? = 2 ] ; then
 echo &amp;quot;Socket $SSH_AUTH_SOCK is dead! Deleting!&amp;quot;
 rm -f $SSH_AUTH_SOCK
 return 4
 else
 echo &amp;quot;Found ssh-agent $SSH_AUTH_SOCK&amp;quot;
 return 0
 fi
 else
 echo &amp;quot;$SSH_AUTH_SOCK is not a socket!&amp;quot;
 return 3
 fi
}

function sshagent_init {
 # ssh agent sockets can be attached to a ssh daemon process or an
 # ssh-agent process.

 AGENTFOUND=0

 # Attempt to find and use the ssh-agent in the current environment
 if sshagent_testsocket ; then AGENTFOUND=1 ; fi

 # If there is no agent in the environment, search /tmp for
 # possible agents to reuse before starting a fresh ssh-agent
 # process.
 if [ $AGENTFOUND = 0 ] ; then
 for agentsocket in $(sshagent_findsockets) ; do
 if [ $AGENTFOUND != 0 ] ; then break ; fi
 if sshagent_testsocket $agentsocket ; then AGENTFOUND=1 ; fi
 done
 fi

 # If at this point we still haven't located an agent, it's time to
 # start a new one
 if [ $AGENTFOUND = 0 ] ; then
 eval `ssh-agent`
 fi

 # Clean up
 unset AGENTFOUND
 unset agentsocket

 # Finally, show what keys are currently in the agent
 ssh-add -l
}
&lt;/code>&lt;/pre>
&lt;p>&lt;a href="https://superuser.com/a/141241">source&lt;/a>&lt;/p></description></item></channel></rss>