2013-04-21 161 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 

? =)