I am trying to automate ssh-keygen creating keys without a passphrase. How can I run a script that calls ssh-keygen so that it does NOT require a passphrase? When I was testing on the command line I created a file that contained 2 line feeds and piped it into stdin. I got a message mentioning that ssh-askpass could not be found and it completed. I did not try the keys but I would like to be able to generate them without any error messages. Is this possible? thanks -- What profits a man if he gains the whole world yet loses his soul?
Hi Doug-- On April 17, dlochart at gmail.com said: > I am trying to automate ssh-keygen creating keys without a > passphrase. Modern versions of openssh's ssh-keygen allow you to specify a new passphrase on the command line with the -N argument. So: ssh-keygen -N '' -f ./newkey -t rsa -q would make ./newkey (the passwordless, private key), and ./newkey.pub (the public key). It should return without errors in most normal situations. -q ("quiet") avoids printing the normal status messages generated by ssh-keygen. Please read the man page for ssh-keygen ("man ssh-keygen" or use the web [0]) for more details. hth, --dkg [0] http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygen
Doug Lochart wrote:> I am trying to automate ssh-keygen creating keys without a passphrase. > How can I run a script that calls ssh-keygen so that it does NOT > require a passphrase? When I was testing on the command line I > created a file that contained 2 line feeds and piped it into stdin. I > got a message mentioning that ssh-askpass could not be found and it > completed.That didn't work because ssh-keygen reads its passphrases from its controlling terminal (or ssh-askpass) not stdin.> I did not try the keys but I would like to be able to > generate them without any error messages. Is this possible?$ ssh-keygen -N '' -f foo -- Darren Tucker (dtucker at zip.com.au) GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69 Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.