shell无交互式ssh-keygen生成密钥脚本

作者: admin 分类: Linux,Shell脚本 发布时间: 2018-01-25 16:26 浏览:772 次    

 

[root@VM_96_242_centos ~]# vim ssh_key.exp
#############################################################
 # File Name: help.sh
 # Author: 寻音
 # E-mail: lnhxzwb@126.com
 # Created Time: Wed 25 Jan 2018 15:22:13 PM CST
 #=============================================================
#!/usr/bin/expect
set timeout 30
spawn ssh-keygen
expect ":"
send "\r"
expect ":"
send "\r"
expect ":"
send "\r"
expect eof
exit

 

 

 

 


温馨提示:如无特殊说明,本站文章均为作者原创,转载时请注明出处及相应链接!

发表评论