NCNU-OpenSource
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Mail Server 筆記統整 [TOC] ## 什麼是郵件伺服器? 郵件伺服器是專門用於寄送、接收電子郵件的服務,讓你能夠寄信給世界各地的任何人。 ## 電子郵件位址寫法 電子郵件的位址寫法通常是 `帳號@主機名稱`,例如:`lin@gmail.com`。 ## 郵件傳輸過程中經過的節點與使用的協定 ### 相關協定概覽 郵件傳輸涉及的主要協定包括: * SMTP (Simple Mail Transfer Protocol) * POP (Post Office Protocol) * IMAP (Internet Message Access Protocol) * MIME (Multipurpose Internet Mail Extensions) 下圖顯示了郵件傳輸過程中經過的節點與使用的協定: ![郵件傳輸過程中經過的節點與使用的 Protocol](https://hackmd.io/_uploads/SyURHUCEn.png) ### 系統組成元件 * **MUA (Mail User Agent,郵件使用者代理)** * 俗稱電子郵件客戶端。 * 功能:寄送、接收 Mail Server 的電子郵件。 * 使用 SMTP 傳送信件給 SMTP Server。 * 使用 POP3 或 IMAP 接收及管理信件。 * 範例:Linux 的 Kmail、Apple Mail App、Thunderbird。 * **MTA (Mail Transfer Agent,郵件傳送代理)** * 使用 SMTP (port 25) 或是 SMTPs (port 465/port 587)。 * 功能:轉遞信件。 * 如果信的目的地是本機上的使用者,信件就直接送到該使用者的 Mailbox。 * 如果信的目的地不是本機上的使用者,就需要將信轉送給下一台 MTA。 * **MDA (Mail Delivery Agent,郵件遞送代理)** * 掛在 MTA 下的一個小**程式**。 * 功能: * 分析 MTA 收到這封信的 header 或內容等資料,決定郵件的去向。 * 過濾垃圾信件 (根據 header 或特定內容)。 * 自動回覆。 * 主要將信件投遞給本機使用者的 Mailbox。 * 可以依據信件內容過濾或是分類收到的信件。 * **Mailbox (電子信箱)** * Linux 系統預設的信箱放在 `/var/spool/mail/使用者帳號`。 ### 郵件協定詳述 * **SMTP (Simple Mail Transfer Protocol)** * 主要用來**傳送**電子郵件。 * 內容基於純文字。 * Port: * `25`:預設的 SMTP port 號。許多 ISP 為了避免客戶發送垃圾郵件會封鎖 port 25,現在 port 25 主要用作 Server to Server 傳送郵件。 * `465`:透過 SSL 加密。 * `587`:透過 TLS 加密 (最新的標準)。 * **POP3 (Post Office Protocol version 3)** * 從伺服器上下載電子郵件到本地設備的通訊協定。 * 內容基於純文字。 * Port: * 不安全:`110`。 * 安全:`995`,透過 TLS/SSL 加密。 * 特性:郵件下載到電腦上後,Mail Server 會將使用者 Mailbox 內的資料刪除。已傳送的郵件不會存在 Mail Server 中,而是存在你的本機上。 * **IMAP (Internet Message Access Protocol)** * 在郵件伺服器上**存取和管理電子郵件**的協定。 * 內容基於純文字。 * Port: * 不安全:`143`。 * 安全:`993`,透過 TLS/SSL 加密。 * 特性:從 Mail Server 上讀取信件,讓你可以在任何地方、使用任何裝置存取電子郵件。除非你點下載按鈕,否則不會自動下載信件。是現代較常使用的 Protocol。 :::info SMTP、POP3、IMAP 的明文傳送不安全,可能導致中間人攻擊、郵件偽造、病毒郵件或帳號密碼被攔截。因此發展出加密的通訊協定如 SMTPs、POP3s、IMAPs。 ::: ## 運作流程 ![郵件運作流程圖](https://hackmd.io/_uploads/Syn1JD-ryg.png) ### 寄信過程 情境:秋分要寄信給魷魚 (寄信人:`chofinn@gmail.com`,收信人:`squid@yahoo.com.tw`)。 1. **步驟 0**:寄件人取得 MTA 的使用權限,註冊一組可使用的帳號、密碼。 2. **步驟 1**:寄件人透過 MUA 寫信,然後傳送至自己的 MTA 上。 * 信件主要資料包括信件標頭 (寄件者、收件者、主旨) 和信件內容。 * 完成編寫並傳送後,信件會送到你的 MTA 伺服器,而不是對方的 MTA。 3. **步驟 2-1**:如果這封信的目的地是本機 MTA 使用者的帳號,MDA 就直接將這封信送到該使用者地 Mailbox。 4. **步驟 2-2**:如果這封信目的地為其他 MTA,則開始 Relay。 * MTA 開始分析該封信是否具有合法的使用權限。 * 有權限:MTA 將信寄給下一部 MTA 的 SMTP (port 25)。 5. **步驟 3**:收件方的 MTA 接收寄件方發出的信,並將信放到正確的使用者信箱中。 * 收件方的 MTA 收到寄件方的信後,MDA 會將這封信送到魷魚的 Mailbox,等魷魚登入讀取、下載。 :::info 這封信最終是停留在收件方 MTA 上,而不是在收件人 MUA 上!所以 MUA 不必一直開著;要收信時再打開即可。 ::: #### 郵件傳送中的重要概念 * **MX (Mail eXchanger)** * DNS 上的一種記錄,用來解析 Email 中 `@` 後的主機名稱。 * 當郵件傳送出去時,會先看這個 Domain Name 的 MX 紀錄。 * 找到 MX Server 後,就將信傳送過去。 * 如果沒有設定好 MX 紀錄,則會查找 A record。 * 假設寄信給 BT (`BlueT@BlueT.org`) 的 MX 查詢範例: * ![MX紀錄範例1](https://hackmd.io/_uploads/Bk_QuEBVgg.png) * ![MX紀錄範例2](https://i.imgur.com/s63qYGf.png) * ![MX紀錄範例3](https://hackmd.io/_uploads/SJmNOVHEgg.png) * 如果有多台 MX Server,則依照優先權選一台作為送信的目的地,如果都沒有則會用最原本的 `BlueT.org` 當作目的,如果還是沒有就回覆失敗給寄件人。 * **Relay (中繼、轉發)** * 指的是 MTA 接收信件並轉發給下一個 MTA 的過程。 * **電子郵件認證機制 (安全性措施)** * 以前網路環境較信任,但因身分偽造、釣魚郵件等問題導致財物損失甚至憾事,因此發展出多種防偽措施。 * **DKIM (DomainKeys Identified Mail)** * 透過 DNS 的 TXT 紀錄,傳送方會在 email header 插入 `DKIM-Signature` 及相關數位簽章資訊。 * 接收方透過 DNS 紀錄得到公開金鑰進行驗證寄件者、主旨、內文、附件等是否有被偽造或竄改。 * 查看 DNS 的 TXT record 中的 DKIM 紀錄:`dig google._domainkey.bluet.org TXT`。 * **SPF (Sender Policy Framework)** * 透過 DNS 的 TXT record,可以設定某 IP 範圍或網域是否能代表此網域發送郵件。 * 查詢一個網域的 SPF record 方法:`dig TXT josh-hsieh.tw` 後找到有寫 `v =spf include:....` 那行。 * ![SPF record 範例](https://hackmd.io/_uploads/H1H8NDbHyg.png) * 查看 DNS 的 TXT record 中的 SPF 紀錄:`dig bluet.org TXT`。 * **DMARC (Domain-based Message Authentication, Reporting and Conformance)** * 透過 DNS 的 TXT 紀錄,DMARC 決定在對一封電子郵件進行 SPF 和 DKIM 紀錄檢查後發生的情況。 * DMARC 決定當 email 未通過檢查時,會被標記為垃圾郵件、被封鎖,還是被傳遞給預定地收件者。 * SPF、DKIM、DMARC 成為一套電子郵件認證機制,可以檢測及防止偽冒身分、對付網路釣魚或垃圾電子郵件。 * 範例:垃圾郵件發信者若無權從 `@example.com` 網域發送郵件,會替換寄件者標頭,接收郵件的伺服器可利用 DMARC、SPF、DKIM 判斷這是未授權郵件並標記為垃圾郵件或拒絕。 * 查看 DNS 的 TXT record 中的 DMARC 紀錄:`dig _dmarc.bluet.org TXT`。 * **DNSSEC & DNS Spoofing** * 以前 DNS 被認為可靠,但後來被偽造,所以需要安全措施,稱為 DNSSEC。 * DNS 是 UDP 協定,攻擊者若偷聽到你的查詢並搶先回覆,就容易發生 DNS Spoofing。 * 另一種 DNS Spoofing 做法是,攻擊者持續向 DNS Relay 伺服器發送錯誤的 IP 地址(例如 `google.com` 的 IP 是 `1.2.3.4`),待其快取過期後,該伺服器就會相信錯誤資訊,進而汙染整個學校的 DNS。 * 查看 DNSSEC:[https://dnssec-analyzer.verisignlabs.com/bluet.org](https://dnssec-analyzer.verisignlabs.com/bluet.org)。 * 在學校環境中,查詢 DNSSEC 紀錄需要指定伺服器: ```bash dig @1.1.1.1 bluet.org. DS dig @1.1.1.1 bluet.org. DNSKEY ``` ### 收信過程 情境:魷魚要收信 (寄信人:`chofinn@gmail.com`,收信人:`squid@yahoo.com.tw`)。 1. **步驟 1**:MUA 透過 POP3 (port 110) 或 IMAP (port 143) 協定連接到 MRA (Mail Retrieval Agent),並且輸入帳號與密碼來取得正確的認證與授權。 2. **步驟 2**:MRA 確認使用者帳號、密碼無誤後,會前往該使用者的 Mailbox (`/var/spool/mail/使用者帳號`) 取得使用者的信件並傳送到使用者的 MUA 軟體上。 ## Postfix 郵件伺服器 Postfix 是為比 Sendmail 更好而開發的。 * **Sendmail 缺點**:效能不理想、不夠安全、設定檔 `sendmail.cf` 難以理解。 * Postfix 作為 MTA、SMTP Server/Client。 * 運行在 Unix-like OS 上。 * 是第二常用的 Mail Server (第一名是 Exim)。 * Exim 自訂性高,可根據需求進行複雜設定。 * Postfix 新手友善,容易配置。 * **設計目標**: * **兼容性**:基本 100% 相容 Sendmail 的檔案。 * **穩定性**:在 Overload 情況下仍可保證程式的可靠性,當沒有足夠空間或記憶體時,Postfix 會選擇放棄而不是重試。 * **靈活性**:由多個 module 組成,可依照需求安裝所需 module (`apt search postfix | grep postfix`)。 * **安全性**。 ### Postfix 安裝與設定 * **安裝指令**: ```bash sudo apt install postfix ``` * 安裝過程中會有設定選項。 * **重新設定**: ```bash sudo dpkg-reconfigure postfix ``` * 可查看詳細設定檔 (直接看 `main.cf` 也可以)。 * **設定類型選項**: * **No configuration** * **Internet site**:透過 SMTP 進行寄信,可以收外面的信,也可以收 Local 內使用者互相寄的信。一般公司或單位使用。 * ![Postfix Installation - Internet site option](https://i.imgur.com/Qo06pI6.png) * **Internet with smarthost**:要寄到外面的信件會經由其他 Mail Server 來轉發。適用於想要透過外部 Server (如 `google.com`) 幫忙寄信的場景。 * **Satellite system**:Local 內及外面的信件都由其他 Mail Server 轉發。跨國公司常用,例如主機在美國,可透過其他地方的 Satellite System 寄送。 * **Local only**:只有主機內使用者可以互相寄信。一般主機、家用電腦、測試用。 * **重要設定項目**: * **System mail name**:寄信出去時要顯示的名稱。 * ![Postfix Installation - System mail name](https://i.imgur.com/A9AxLsj.png) * **Root and postmaster mail recipient**:寄到 root 跟 postmaster 的信件會被轉寄到哪個使用者。 * ![Postfix Installation - Root and postmaster mail recipient](https://i.imgur.com/DNmhv4y.png) * ![Postfix Installation - Root and postmaster mail recipient example](https://i.imgur.com/UuoArci.png) * **Other destinations to accept mail for**:寄到主機內的信件是這些 Domain 的才會接收。 * ![Postfix Installation - Other destinations to accept mail for](https://i.imgur.com/5RfAiBw.png) * **Local address extension character**:預設為 `+` 號。表示忽略**符號**後的內容,可應用於內部信件分流。 * 例如:`ta+squidxoxo@lsa.kija` 會寄給 `ta@lsa.kija`。 * **安裝後確認**: * 確認 TCP Port 25 是否正在監聽: ```bash sudo netstat -ntupl | grep 25 | less # 或使用 sudo ss -tlnp ``` ### Postfix 重要檔案/目錄 * `/etc/postfix/main.cf`:主要設定檔。 * `myorigin=/etc/mailname`:希望用在 `@` 後面的名稱,配置 SMTP 的 Domain Name。 * `myhostname`:Email 中 `@` 後面的部分,主機名稱 (安裝 Postfix 這台主機的名稱)。 * `inet_interfaces`:SMTP 要監聽的 IP 位址,`all` 代表監聽所有網路介面。若有重複設定,以最晚出現的設定值為準。 * `mydestination`:在許多主機名稱中,寫入這個設定值的名稱才能被作為 Email 的主機名稱。如果 DNS 的設定裡有 MX,指向的那台主機一定要寫在 `mydestination` 裡面。 * `mynetworks`:設定可以用這個 Server 做轉發的用戶。 * `relayhost`:設定將所有寄出的信件給某台 Server 做轉發。 * `/etc/mailname`:系統預設的 Server Name。 * `/etc/aliases`:信箱的別名,可以設定成群組,一次寄給很多人。 * `/var/mail/{userName}`:收件匣。 * `/var/spool/postfix`:寄件佇列 (Queue)。 ### Postfix 寄信操作 * **使用 `mailutils` 發送郵件** ```bash sudo apt install mailutils echo "Hello, this is a test mail." | mail -s "Test Email" {要將郵件送到的主機位置:username@host} ``` * 可在 `/var/mail/{username}` 看到郵件內容。 * 也可下 `mail` 指令查看。 * **利用 `telnet` 發送郵件 (SMTP DEMO)** ```bash # 連線到 Mail Server 的 SMTP port (預設 25) telnet smtp.ncnu.edu.tw 25 # 或本機測試 telnet localhost 25 # 確認連線成功後,打招呼 (Host 名稱可隨意) HELO gmail.com # 須回傳 250 {username@host} 代表成功連線 # 寄件人 (必須使用 <> 包裹) MAIL FROM:<a@ncnu.edu.tw> # 須回傳 250 2.1.0 OK # 收信人 (完整的 email 名稱,必須使用 <> 包裹) RCPT TO:<{要寄給誰@mail.com}> # 須回傳 250 2.1.0 OK # 開始寫信內容 DATA # 須回傳 354 End data with <CR><LF>, <CR><LF> # 輸入主旨 Subject: {主旨} # 輸入信件內容 {信件內容} # 內容結束符號 (新的一行輸入一個點 . 後按 Enter) . # 須回傳 250 2.1.0 OK: queued as ... # 退出連線 QUIT ``` ### 群組寄信法 1. **新增 alias 紀錄** (`sudo vim /etc/aliases`) ``` jobs: {user_name}, {完整 email 地址}, root ``` 2. **更新 alias 資料庫並重載 Postfix 服務** ```bash sudo postalias hash:/etc/aliases # postalias 用來更新 db 的指令 後面是要更新的 db sudo service postfix reload ``` ## Mailbox 格式 * **mbox vs. Maildir** * `mbox` 是一種檔案格式,如果該檔案毀損,所有信件都可能遺失。 * `Maildir` 是一種目錄結構,單一郵件檔毀損時不影響其他信件。 * 查看 `/var/mail` 裡面自己的信件紀錄。 * **mbox 轉 Maildir** 1. 安裝 `mb2md`:`sudo apt install mb2md`。 2. 新增一個要拿來放 Maildir 的資料夾。 3. 執行轉換指令: ```bash sudo mb2md -s /var/mail/squidxoxo -d /var/mail/squidxoxo-dir/ ``` * 可下載 `tree` 指令更方便查看資料夾下的內容。 ## 郵件收信操作 * **POP3 收信** * Postfix 透過 SMTP 作為 MTA,沒有內建 POP3 及 IMAP,需要另外安裝 `dovecot` 等 Mail Server。 * **安裝**:`sudo apt install dovecot-imapd dovecot-pop3d` * **連線**:`telnet localhost 110` * **登入**: ```bash USER {username} # 回傳 +OK PASS {password} # 回傳 OK Logged in. ``` * **列出收件匣內信件 (以編號顯示)**:`LIST` * 回傳 `+OK {} messages` * **查看信件 (選擇編號)**:`RETR [Num]` * **退出**:`QUIT` * **IMAP 收信** * IMAP 的指令前面會多一個 `{an}`,`an` 依輸入命令編號,回傳訊息也可以知道是根據哪一個使用者命令回傳,可以是 `t1`、`b2`、`Q`、`ZEN` 等。 * **連線**:`telnet localhost 143` * **登入**: ```bash a1 LOGIN {username} {password} ``` * **查看信件夾**: ```bash a2 SELECT INBOX ``` * **查看第一封到最後一封信件 (主題和寄件者)**: ```bash a3 FETCH 1:* (FLAGS BODY[HEADER.FIELDS (SUBJECT FROM)]) ``` * **查看第一封信件內容**: ```bash a4 FETCH 1 BODY[TEXT] ``` * **退出**: ```bash a5 LOGOUT ``` ## 其他相關工具與概念 (LSA Week 9 筆記中提及) 這些工具雖然不完全是 Mail Server 本身,但在系統管理與檔案傳輸方面與郵件伺服器筆記一同出現。 ### scp (Secure Copy Protocol) * 安全性高,但需要經常打指令。 * 指令格式:`$scp {檔案} {username}@{ip}:{路徑}` * 範例:`$scp index.html username@10.10.10.10:~/home/username/directory` * 上傳檔案會預設成 `664` 權限,若要更高可到 config 檔更改。 * 針對有設定安全性的提醒:有的人會把預設 Port 更改。 * `-P` 指定 Port,若是預設 22 則可以不用輸入。 * 範例:`$scp -P {port} {檔案名稱} {username}@{ip}:{路徑}`。 ### sftp (SSH File Transfer Protocol) * 比 FTP 安全,一般主機只要有 SSH 就可用 SFTP。 * 指令格式: ```bash $ sftp {username}@{ip} sftp> get {path} ``` * 範例: ```bash $ sftp index.html username@10.10.10.10 sftp> get index.html ``` * **sftp 指令**: * 在指令前面多打個 `l` 代表在本地端執行。 * `pwd` -> Current Directory。 * `lpwd` -> Local Current Directory。 * `get *` -> Download whole file within the directory。 * 好軟體推薦:[FileZilla](https://filezilla-project.org/)。 ### ncftp * **安裝**:`$ sudo apt install ncftp` * **使用**: ```bash $ ncftp ftp.ncnu.edu.tw ncftp> get robots.txt ``` * **指定使用者登入**:`$ ncftp -u {username} -p {password}` * 若無 `-u` 則預設使用 `anonymous`。 ### Samba * **新增本機使用者**: * `$ sudo adduser {username}`:新增使用者並帶 Home Directory。 * `$ sudo useradd {username}`:新增使用者但不帶 Home Directory。 * **更改 Samba 設定**:`$ sudo vim /etc/samba/smb.conf` * `smb.conf` 檔內底端增設分享設定,範例如下: ```ini [{分享檔案名稱}] comment = path = {PATH TO SHARE} public = yes writable = yes ;read only = no directory mode = 0755 create mode = 0755 [homes] comment = Home Directories browseable = no writable = yes create mode = 0644 directory mode = 0755 [SharedDir] comment = Shared Directory path = /Test public = yes writable = yes ;read only = no directory mode = 0755 create mode = 0755 valid users = @group ``` * `0755` = `rwxr-xr-x`,關於 `rwx` 請參考 LINUX 鳥哥。 * **連接測試**: * Linux/Mac: `smb:\\{ip}`。 * Windows: 1. `\\{ip}`。 2. `Windows Key + R`, type `\\{ip}`。 * **設定群組**:修改 `/etc/group`。 * 範例:`samba:x:1001:BlueT,Alice,Bob` 代表 `BlueT, Alice, Bob` 都在 `samba` 群組內。 ### 其他指令與概念 * `$ sudo dpkg -i chrome-fdrtyttfy.deb`:`-i` = install。 * `$ sudo apt install -f`。 * `$ sudo dpkg-reconfigure postfix`:將此套件重新設定一次。 * **aptitude**:可透過相依關係查詢。 * `/` -> `bad-mailx` -> `/` -> `postfix`。 * **安裝後請確保是否可執行以下指令**:`iptables`、`route`。

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully