在Centos8上配置Minio服务使用TLS

创建minio的配置目录

mkdir /etc/minio

在minio的启动指令后面加上  --config-dir /etc/minio

[root@iZuf66s66e1t3c7lg5i0vvZ tls]# cat /usr/local/minio/etc/minio.conf 
MINIO_VOLUMES="/usr/local/minio/data"
#端口:默认9000
MINIO_OPTS="--address ':9000' --console-address ':9001' --config-dir /etc/minio"
#登录名
MINIO_ROOT_USER=minio
#登录密码
MINIO_ROOT_PASSWORD=step1230
[root@iZuf66s66e1t3c7lg5i0vvZ tls]# 

查看本机ip

[root@iZuf66s66e1t3c7lg5i0vvZ certs]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.25.127.66  netmask 255.255.240.0  broadcast 172.25.127.255
        inet6 fe80::216:3eff:fe23:1184  prefixlen 64  scopeid 0x20<link>
        ether 00:16:3e:23:11:84  txqueuelen 1000  (Ethernet)
        RX packets 946638186  bytes 165228785063 (153.8 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 939379163  bytes 154319633734 (143.7 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

我的IP是 : 

172.25.127.66

编辑文件  /etc/pki/tls/openssl.cnf

找到

[ v3_ca ]

新增一行

subjectAltName=IP:172.25.127.66

编辑完后保存退出!!

不编辑openssl.cnf文件的后果就是:minio控制台登录不了

创建目录/etc/minio/certs 后进入,如果已存在可直接进入,在当前目录使用 OpenSSL 来生成私钥文件和自签名证书

生成私钥:

openssl genrsa -out private.key 2048

生成自签名证书:

openssl req -new -x509 -days 3650 -key private.key -out public.crt -subj "/C=US/ST=state/L=location/O=organization/CN=domain"

参考:

http://docs.minio.org.cn/docs/master/how-to-secure-access-to-minio-server-with-tls

最后 检查/etc/minio目录是否属于minio:minio,如果不是就需要执行以下命令

chown -R minio:minio /etc/minio

最后重新加载配置、启动minio

systemctl daemon-reload

systemctl start minio
原文地址:https://www.cnblogs.com/517cn/p/15751076.html