Setting Up Automated logins via ssh

Quick Instructions to enable a script to automatically connect via ssh.

  1. Generate your public key:
    On the local machine (i.e. the one you want to connect from), execute the command ssh-keygen -t dsa
  2. Copy the public key to the remote machine:
    scp ~/.ssh/id_dsa.pub user@remotemachine.com:/root/.ssh
  3. Add the public key to the list of authenticated keys on the remote machine:
    - Login to the remote machine using ssh and your password (as normal), then :
    cat /root/.ssh/id_dsa.pub >> .ssh/authorized_keys
  4. Don't forget to delete the original key files on both the remote and local machines:
    rm /root/.ssh/id_dsa.pub
  5. You might need to set the permissions on .ssh and .ssh/authorized_keys:
    chmod 644 .ssh/authorized_keys
    chmod 700 .ssh

Comments

Post new comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h3> <h2> <h4> <img> <div> <table> <tr> <td> <pre>
  • Lines and paragraphs break automatically.
  • Insert image: [img:node_id align=(left|right) size=(|fullLA|fullPreview|fullSQ|halfLA|halfPO|halfSQ|thirdSQ) action=(popup|link|frame) url=url style="margin:10px;" title=text description=text]

More information about formatting options

 
info@theanthillsocial.co.uk XHTML 1.0 Strict CSS2 WAI