For those of you yet to experience the pure joy of SSH used properly:

On a unix box: (or Cygwin).

%> ssh-keygen -b 1024 -t RSA <key in a good passphrase twice>

Now let's copy the Public key to the remote machine you want to have access to:

cat .ssh/id_rsa.pub | ssh -l<user> <target_ip> '[ -d .ssh ] || mkdir . +ssh ; chmod 700 .ssh ; cat - >> ~/.ssh/authorized_keys'

Now let's start up ssh-agent. You can either run you WM via ssh-agent: Add the following to your .xinitrc file:

exec /usr/bin/ssh-agent <Window Manager of choice>

or to your .bashrc:

SSHAGENT=$(which ssh-agent) SSHAGENTARGS="-s" if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then eval `$SSHAGENT $SSHAGENTARGS` trap "kill $SSH_AGENT_PID" 0 fi

Hooray... We're all set

Now, run ssh-add to add your private key passphrase to the ssh-agent keyring:
%>ssh-add <key in your passphrase>

Now, you can log into the remote machine with wanton abandon.


Repeat as necessary

I hope you'll all forgive the non-perlness of this post but I thought someone, somewhere may just find it usefull.

SM


In reply to Re^2: OT - SSH Help by smullis
in thread SSH Help by bear0053

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.