最新留言:

SSL & Root CA 實作

roach 發表於 Linux 週四 1 九月 2005 5:22 上午

Step.1 產生 Root CA
cd /usr/share/ssl/misc
./CA -newca
輸入路徑,不輸入Enter跳過,預設路徑為
/usr/share/ssl/misc/demoCA/cacert.pem
輸入密碼,請牢記, 如果忘記, 以後你便無法簽發憑證, 除非重新產生Root CA
再打一次
輸入CA的資料,不要輸入你的網站的資料,這是簽發憑證中心,不是你申請憑證網站
之後你會有兩個檔案
Root CA 憑證 usr/share/ssl/misc/demoCA/cacert.pem
Root CA Private Key /usr/share/ssl/misc/demoCA/private/cakey.pem

Step.2 產生使用者憑證(你的Server要申請憑證)
cd /usr/share/ssl/misc
./CA -newreq
跟產生 CA 鎖要輸入的資料差不多, 只有 CN 一定要正確, 其他就看你了
Step.3 分離憑證申請書以及 Private Key
head -18 newreq.pem > private.key
取得前18行為priveate.key
sed 1,18d newreq.pem > newreq.pem.1
mv newreq.pem.1 newreq.pem
刪除申請書的前18行
openssl rsa -in private.key -out server.key
拿掉申請憑證時所設定的密碼,如果你是要給 apache 用的話,
你不希望每次啟動跟都要打一次密碼的話, 請拿掉.

Step.4 CA 對憑證申請書進行簽章
cd /usr/share/ssl/misc
./CA -sign (輸入當初設定 Root CA 時所設的密碼)
sed 1,45d newcert.pem > /usr/share/ssl/certs/dovecot.pem
cp server.key /usr/share/ssl/private/dovecot.pem

重新啟動 dovecot , 以及刪除 /usr/share/ssl/misc
下所產生的 newcert.pem newreq.pem private.key server.key
/usr/share/ssl/certs/dovecot.pem
這個檔案複製下來到 user 端改為 *.crt 匯入收信程式的憑證即可~

ps. 如果要更改憑證有效日期在簽章憑證之前請修改
/usr/share/ssl/openssl.conf 將 default_days 修改成你要的有效時間

SAMBA & 中文

roach 發表於 Linux 週四 1 九月 2005 5:17 上午

讓 SAMBA 支援中文
在 globeal 設定加上
client code page = 950
那是 samba 2.x 用的…
3.0 請加上
unix charset = cp950

Blog…

roach 發表於 雜記 週四 1 九月 2005 3:49 上午

去年年底開始學習 Linux 今年初也很順利的拿到一張保證書,
不過, 沒有繼續努力, 那也張廢紙, 為了讓那張廢紙的保固期增加,
我開始把自己一些使用的 tips 整理起來, 放在論壇裡,
但是看起來沒什麼條理, 看到很多朋友都有Blog,
整理起來很有條理的樣子, 不知如何入手…
跟一位很會吃的妖僧請教,
然後一直到剛剛趁著颱風夜消磨時間就把他裝上去了…
真他媽的簡單… orz, 總之… 開張了…


978Area is poudly powered by wordpress
訂閱本站 (RSS) and 訂閱回應 (RSS).total of 1930321 visits