bloginfo('name');

bloginfo('description');

Cache SSH passwords

Januar 17th, 2007 by Blu:RayNe

You know the annoyence when SSH again and again asks you to enter the password?

Well, SSH does not allow caching of passwords. Caching would be nonsense since all the security of SSH would then be gone. But you can use RSA to create a private/public pair of keys and send the remote host the public key of your server.

First, we create the key pair:

ssh-keygen -t rsa

The last step of the key creation is the passphrase. Since the purpose of this is to not enter a password, hence being able to create batch jobs, just hit “Enter” twice, leaving them blank.

Then we’ll have to copy the public key to the remote host:

  1. First create directory for SSH if not existent
    ssh root@example.com "mkdir .ssh; chmod 600 .ssh"
  2. Then we have to copy the public key of our machine to the remote server

    scp ~/.ssh/id_rsa.pub root@example.com:~/.ssh/authorized_keys2

    (Ensure authorized_keys2 does not exist on remote host!)

Filed under Linux having

2 Responses

  1. hier klicken says:

    hier klicken…

    The period of relentlessly searching for credible attitudes on this idea have ceased….

  2. Supremato says:

    Hello! Visit free adult dating site: http://free-adult-dating.thumblogger.com/
    World’s Largest Adult Social Network and Sex Personals. Hot Singles, Hot adult Photos, Real Webcams.
    Make new friends, find hot singles, wild couples & sexy groups.
    Millions of members. Free Sign Up. JOIN NOW!

Leave a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.