Please advice how to generate the file id_rsa.pub without answering the questions from "ssh-keygen -t rsa"
my target is to run the ssh-keygen from bash script from postgress USER, and it must run interactive , or maybe run the id_rsa.pub with different syntax ?
Example - this approach ins"t interactive :
su - postgres -c "ssh-keygen -t rsa"
Generating public/private rsa key pair.
Enter file in which to save the key (/var/lib/pgsql/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /var/lib/pgsql/.ssh/id_rsa.
Your public key has been saved in /var/lib/pgsql/.ssh/id_rsa.pub.
The key fingerprint is:
a5:c8:fb:ff:fa:3b:55:59:9c:90:4e:28:35:f0:46:7c
The key's randomart image is:
+--[ RSA 2048]----+
| .++..o..|
| .oo.E .o|
| oo+ o|
| . . o. . ..|
| o S . |
| . . |
| . . |
| . . |
| ..o++o |
+-----------------+
# ls
authorized_keys id_rsa id_rsa.pub known_hosts
I already try the following by EOF loop in order to answers the ssh-keygen interactive but without success
# su - postgres -c "ssh-keygen -t rsa
>
>
> <<<EOF"
Generating public/private rsa key pair.
Enter file in which to save the key (/var/lib/pgsql/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):