[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: scp



Florian Steurer <florian.steurer@alcatel.ch> writes:
> I try to write a backup (shell-)script and use the "scp"-command. It
> asks for a password, how can I automize the passwort prompt -> I mean

  RTFM ;-). `man ssh' describes how you can copy your public key to
  your ~/.ssh/authorized_keys file on the remote host.

  Unless you can physically guarantee that your public key cannot be
  compromised, I would strongly urge you to protect it with a pass
  phrase (which you were asked to enter when creating the key with
  ssh-keygen).

  Now, if you use a pass phrase, you have to enter it each time you
  use your private key, which is what you would have to do when using
  scp. What the other folks didn't mention is that you should then
  ensure that ssh-agent is running so that you can run `ssh-add,'
  enter your pass phrase, and not have to be asked for your pass
  phrase again during that session.

  Note that Debian/Gnome/X installations start ssh-agent for you.
  However, if $SSH_AGENT_PID is not defined, you can start it yourself
  like this:

    $ exec ssh-agent bash

  This runs a bash shell under the ssh-agent. As described above, use
  ssh-add to enter your pass phrase for the session, and then scp
  away.

  You can then run `ssh-add -d' to forget your passphrase, which you
  should do when leaving your terminal in a public environment.

-- 
Bill Wohler <wohler@newt.com>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and mh-e. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.



Reply to: