需求批量实现自动发送公钥到远程主机环境firewalld:关闭selinux:关闭实现方式sshpass命令shell调用expect命令sshpass命令#!/bin/bash##********************************************************************#Author:hechunping#QQ:×××#Date:2019
分类:
系统相关 时间:
2019-11-08 09:18:03
阅读次数:
129
一.用expect实现交互式输入#!/usr/bin/expect-fsetLUKS_passphrasexxxx123setVerify_passphrasexxxx123spawncryptsetupluksFormat/dev/vdb1expect"Areyousure?(Typeuppercaseyes):"settimeout5send"YES\r"expect"EnterLUKSpassphrase:"settimeout5send"$LUKS_passphrase\r"expe..
分类:
其他好文 时间:
2015-12-09 19:52:29
阅读次数:
206