- ESXI
web开启ssh 进入datastore1新建备份目录,并进入此目录 备份现有证书:
tar -czvf cert.tar /etc/vmware/ssl
现下载阿里云ssl证书nginx版,解压,并上传至刚刚datastore1的备份目录 现目录下有如下文件:
xxxx_esxi.yourdomain.com.pem
xxxx_esxi.yourdomain.com.key
使用如下命令转换pem为crt格式证书:
openssl x509 -inform PEM -in xxxx_esxi.yourdomain.com.pem -out rui.crt
现在使用如下命令替换现有证书并重启esxi:
cp rui.crt /etc/vmware/ssl/
cp xxxx_esxi.yourdomain.com.key /etc/vmware/ssl/rui.key
注意: 如果当前操作是在维护模式下进行,在当前terminal下直接重启服务就行:services.sh restart 如果当前操作是在非维护模式下进行,需重启ESXI server
- LEDE
在ESXI web控制台--存储选项--选择数据存储浏览器 下载刚刚我们转化的证书文件
rui.crt
xxxx_esxi.yourdomain.com.key
您可统一命名这些文件,比如我这里 直接改成如下这样:
xxxx_esxi.yourdomain.com.crt
xxxx_esxi.yourdomain.com.key
windows下使用winscp传输文件至lede 如下目录 如没有请新建
/etc/esxi.yourdomain.com/
如果sftp不能连接到lede,请使用如下命令在lede ssh terminal上安装:
opkg update
opkg install openssh-sftp-server
编辑lede uhttp文件 注销原证书路径并填写新的证书路径
vi /etc/config/uhttpd
#option cert '/etc/uhttpd.crt'
#option key '/etc/uhttpd.key'
option cert '/etc/esxi.yourdomain.com/xxxx_esxi.yourdomain.com.crt'
option key '/etc/esxi.yourdomain.com/xxxx_esxi.yourdomain.com.key'
:wq
重启uhttp服务
/etc/init.d/uhttpd restart
使用域名登录你的lede,如输入密码不能登录,请清除浏览器cookie等缓存,刷新后重试。
enjoy it!