如何爲NextCloud添加SSL憑證

2023/03/17閱讀時間約 12 分鐘
ssl憑證
首先開啓終端機

安裝相關套件

切換成su帳號

sudo -i

安裝mod_ssl與openssl

dnf install mod_ssl openssl

使用openssl產生自簽憑證

如果是個人私有網域可以用自簽憑證做測試,如果是要正式運行供外網使用者(如:公司的客戶)就必須跟ssl憑證相關機構申請。

新增2048RSA私鑰匙

使用root帳號執行底下指令的輸出檔案會在/root/資料夾下
openssl genrsa -out mypc.key 2048

新增證書

請輸入底下指令
openssl req -new -key mypc.key -out mypc.csr -sha512
請輸入相關證書訊息及密碼後,按enter會輸出mypc.csr檔
-----
Country Name (2 letter code) [XX]:TW
State or Province Name (full name) []:Taiwan
Locality Name (eg, city) [Default City]:taipei
Organization Name (eg, company) [Default Company Ltd]:
Organizational Unit Name (eg, section) []:IT
Common Name (eg, your name or your server's hostname) []:mypc
Email Address []:[email protected]
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:123456
An optional company name []:IT

新增自簽憑證

openssl x509 -req -days 365 -in mypc.csr -signkey mypc.key -out mypc.crt -sha512
以行動支持創作者!付費即可解鎖
本篇內容共 4999 字、0 則留言,僅發佈於Fedora學習筆記你目前無法檢視以下內容,可能因為尚未登入,或沒有該房間的查看權限。
18會員
39內容數
記錄自己使用Fedora的所見所聞
留言0
查看全部
發表第一個留言支持創作者!