生成SSH密钥bash脚本 [英] Bash script for generating ssh keys

查看:370
本文介绍了生成SSH密钥bash脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建脚本,它只是运行 SSH-凯基-t RSA 。但如何传递给它3次进入?

I would like to create script, which simply runs ssh-keygen -t rsa. But how to pass to it 3 times enter?

推荐答案

尝试:

ssh-keygen -t rsa -N "" -f my.key

-N告诉它使用空密码(同两个在交互式脚本进入)

-N "" tells it to use an empty passphrase (the same as two of the enters in an interactive script)

-f my.key 告诉它来存储钥匙插入 my.key (改变您认为合适的)。

-f my.key tells it to store the key into my.key (change as you see fit).

整个事情运行,你无须提供任何输入键:)

The whole thing runs without you needing to supply any enter keys :)

要发送到进入交互式脚本:

To send enters to an interactive script:

echo -e "\n\n\n" | ssh-keygen -t rsa

这篇关于生成SSH密钥bash脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆