2013-04-21 144 views
-1

我想回答这个问题出现在bash shell中的Bash shell脚本回答

防爆SSH密钥生成的问题:

在脚本

#!/bin/bash 
ssh-keygen -t rsa 

#it will appear a question >> Enter file in which to save the key 
# (/root/.shh/id_rsa) so how can i read answer from the user(which is the path) 
# and **enter it to be the answer of the question. 

回答

0

尝试这样做(无需使用STDIN):

rm -f ~/.ssh/id_rsa* 
ssh-keygen -q -t rsa -P MyOwnPassPhrase -f ~/.ssh/id_rsa 

你读过

man ssh-keygen 

? =)