openssl加密敏感信息

在使用shell脚本远程访问机器进行非交互式操作时,又不想让密码明文存储密码文件中,很有用

root@HDPHIV02 setup]# echo "1qaz@WSX" | openssl enc -aes-256-cbc -a -e -k "-" > passwd.file
[root@HDPHIV02 setup]# openssl enc -aes-256-cbc -a -d -k "-" -in passwd.file
1qaz@WSX
[root@HDPHIV02 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/  

posted on 2017-02-04 11:12  石下江的太阳光  阅读(143)  评论(0编辑  收藏  举报

导航