linux之openssl升级与使用

 ##############

 

 

源码安装来升级openssl:

  • 源码安装:
  • 软连接:bin可执行文件,include头文件,.so文件;
  • 配置文件:配置动态库搜索路径/etc/ld.so.conf

 

# wget  https://www.openssl.org/source/old/1.1.1/openssl-1.1.1q.tar.gz 
# tar -zxvf openssl-1.1.1q.tar.gz 
# cd openssl-1.1.1q 
# ./config --prefix=/usr/local/openssl 
# make -j8 
# make install   

#
ln -sf /usr/local/bin/openssl /usr/bin/openssl # ln -sf /usr/local/include/openssl /usr/include/openssl # ln -sf /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1 # ln -sf /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1
#
echo "/usr/local/lib/" >> /etc/ld.so.conf # ldconfig -v # openssl version # openssl version -a

 

 

dnf安装openssl:

# dnf install -y openssl openssl-libs  openssl-devel openssl-static 

 

 

 

 

 

生成32位随机密码,只包含字母和数字:

 

echo `openssl rand -base64 50  | tr -dc A-Z-a-z-0-9 | head -c${1:-32}`

#############################
date +%s | sha256sum | base64 | head -c 32 ;

 ################

 

##################

posted @ 2020-08-19 10:37  igoodful  阅读(204)  评论(2编辑  收藏  举报