在使用shell脚本远程访问机器进行非交互式操作时,又不想让密码明文存储密码文件中,很有用
[email protected] setup]# echo "[email protected]" | openssl enc -aes-256-cbc -a -e -k "-" > passwd.file
[[email protected] setup]# openssl enc -aes-256-cbc -a -d -k "-" -in passwd.file
[email protected]
[[email protected] setup]# ./remote.sh -i hdphiv01 -a passwd.file -m ssh-cmd -c "ls /opt/"
./remote.sh -i hdphbs41 -p “password” -m ssh-cmd -c cp /opt/setup/CSIInstall/
时间: 2024-10-04 08:59:16