1. creating ssh key with no passphrase
Hi, I also want to be able to create a passphrase-less ssh-key without
any user interaction (like the original poster), but from a batch
script... The funny thing is this:
-- this line, directly typed in the shell, works:
$ ssh-keygen -N '' -C 'comment' -t rsa -b 1024 -f /mydir/usr2-
blahblah.key
Generating public/private rsa key pair.
Your identification has been saved in /mydir/usr2-blahblah.key.
Your public key has been saved in /mydir/usr2-blahblah.pub.
The key fingerprint is: ...
-- however, when I try to toss it into a variable, and execute the
variable contents, it doesn't:
$ mycmd="ssh-keygen -N '' -C 'comment' -t rsa -b 1024 -f /mydir/usr2-
blahblah.key"
$ echo $mycmd
ssh-keygen -N '' -C 'comment' -t rsa -b 1024 -f /mydir/usr2-
blahblah.key
$ $mycmd
Generating public/private rsa key pair.
passphrase too short: have 2 bytes, need > 4
Saving the key failed: /mydir/usr2-blahblah.key.
Apparently, it interprets the quotes in the second case as literal
password characters instead of string delimiters.. Btw, none of the
escaping possibilities work:
$ mycmd="ssh-keygen -N '' -C 'comment' -t rsa -b 1024 -f /mydir/usr2-
blahblah.key"
$ mycmd="ssh-keygen -N \'\' -C 'comment' -t rsa -b 1024 -f /mydir/usr2-
blahblah.key"
$ mycmd="ssh-keygen -N \"\" -C 'comment' -t rsa -b 1024 -f /mydir/usr2-
blahblah.key"
$ mycmd="ssh-keygen -N """" -C 'comment' -t rsa -b 1024 -f /mydir/usr2-
blahblah.key"
... I need this because I want to do something like:
mycmd="ssh-keygen -N '${PASSWDVAR}' -C 'comment' -t rsa -b 1024 -f /
mydir/usr2-blahblah.key"
where PASSWDVAR would be passed to the bash script - and this in fact
works fine, for all cases but when $PASSWDVAR is empty string...
Any help to achieve what I'd want?
Thanks...
2. Wanted: Tool for mounting filesystems in RH7.1
3. ssleay help: req creates SSL key with passphrase???
4. Using the ~%take command under cu
5. ssh dsa passphrase
6. using KDE 2 on LinuxPPC 2000 Q4
7. access of private key passphrases
8. DOS/NT/Linux bootup config?
9. generating a ssh key without ssh-keygen
10. How to use pub keys (not ssh password) in ssh command?
11. RH9: "gpg --gen-key" fails to create keys
12. can ssh-agent work between ssh-2.3 and ssh-3.5
13. Could not create directory '//.ssh'. SSH + keys + Win2K + UNIX (using BASH)