蓬萊人偶
    • Create new note
    • Create a note from template
      • 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
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me 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
    • Save as template
    • 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 Create Help
Create Create new note Create a note from template
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
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me 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
    ###### tags: `1111` `lsa` `ncnu` # Week 15 (2022/12/22) [TOC] - Book mode: https://hackmd.io/@ncnu-opensource/book --- # Mail Server ## 郵件傳輸過程用到的 protocol - MUA (mail user agent) - 郵件使用者代理人 - 功能 - 寄送、接收 mail sever 的電子郵件 - 例如:Linux 的 Kmail - MTA (mail trandfer agent) - 郵件傳送代理人 - 使用 STMP (port 25) 或是 STMPs (port 465/port 587) - 功能 - 轉遞信件 - 如果信的目的地是本機上的使用者,那信就直接送到該使用者的 mailbox 下 - 如果信的目的地不是本機上的使用者,那就需要將信轉送給下一台MTA :::info ### MX(Mail eXchanger) - DNS 上的一個紀錄,用來解析 Email 中 @ 後的主機 - 當郵寄傳送出去時,會先看這個 domain name 的 MX 紀錄是什麼 - 當找到 MS Server 後,就將信傳送過去 >dig bluet.org MX >![](https://i.imgur.com/ZieXa5l.png) >> 數字越小 轉送郵件的 mx server優先權越高 ::: - MDA(Mail Delivery Agent) - 郵件遞送代理人 - 掛在 MTA 下的一個小**程式** - 功能 - 分析MTA 收到的這封信的header 或內容等資料,決定這封郵件的去處 - 過濾垃圾信件 - 根據這封信件的 header,或是特定的信件內容來分析過濾 - 例如: AV情色 - 自動回覆 - Mailbox - 電子信箱 - Linux 系統預設的信箱放在 `/var/spool/mail/ 使用者帳號` - Protocol - SMTP (simple mail transfer protocol) - port - 25: 預設的 SMTP port 號 - 明文傳送,不安全 - 465: 透過SSL加密 - 防止信息洩漏 - 587: 透過TLS加密 - 用途: 寄送電子郵件 #### 一般寄信法 > 透過 telnet ```= telnet localhost(通過哪個 Mail Server 去寄) 25 helo gmail.com(要寄到哪台 server) mail from: (寄件人) rcpt to: (信件要寄到哪個信箱) data (以下輸入信件相關內容) Subject: (信件標題) content (信件內容) 最後enter加個. (寄出) quit (離開) ``` > 若照此方法寄出,通常會被分類到垃圾郵件(因為是用明文傳輸) > ![](https://i.imgur.com/fbLOUix.png) #### 寄信過程 :::success #### 情境 - 秋分寄信給魷魚 - 寄信人:chofinn@gmail.com - 收信人:squid@yahoo.com.tw ::: ![](https://i.imgur.com/nyXTpGM.png) - 步驟0: 寄件人取的MTA使用權限,註冊一組可使用的帳號、密碼 ### 收信 (兩種) - MRA (Mail Retrieval Agent) - 透過 POP3 或 IMAP 接收信件 - Protocol - POP3 (Post Office Protocol version 3) - port - 不安全: 110 (明文傳輸) - 安全: 995,透過TLS/SSL加密 - 從 mail server 下載所有郵件 - 郵件下載到電腦上後,mail server 就會將使用者 mailbox 內的資料刪除 - 已傳送的郵件不會存在在 mail server 中,而是存在你的本機上 - IMAP (Internet Message Access Protocol) - port - unsafe: 143 (明文傳輸) - safe: 993,TLS/SSL 家 - 從mail server 上讀取信件 - 讓你在任何地方、裝置,都可存取電子郵件 - 除非你點下載的按鈕,不然不會自動下載 #### 一般收信法 ```= # postfix 是透過 SMTP 的 MTA 沒有 POP3 及IMAP 要另外安裝 dovecot 等 mail server telnet localhost 110 user {UserName} pass {password} #以明文的方式顯現 list # 列出收信匣內的信件,以編號表示 retr {Num} # 選擇想要看的信件 ``` :::info - SMTP、POP3、IMAP: 明文傳送 $\to$ 不安全 - 可能會因為 Man-in-the-middle 導致電子郵件內容改變 - 郵件偽造 - 病毒郵件 - 帳號密碼會被攔截 - 所以發展出加密的通訊協定 SMTPs、POP3s、IMAPs ::: #### 收信過程 :::success **情境** - 魷魚收信 - 寄信人:chofinn@gmail.com - 收信人:squid@yahoo.com.tw ::: - 步驟1:MUN 透過POP3 (port 110)/IMAP (port 143) 協定連接到 MRA,並且輸入帳號與密碼來取得正確的認證與授權 - 步驟 2 :MRA 確認使用者帳號密碼沒問題後,會前往該使用者的 Mailbox (`/var/spool/mail/使用者帳號`)取得使用者的信件並傳送到使用者的MUA軟體上 ## Postfix - 為了比 sendmail 更好而開發的 - sendmail 缺點: 效能不理想、不夠安全、設定黨 `sendmail.cf` 難以理解 - MTA 、SMTP server/client - 運行在 Unix-like OS 上 - 第二常用的 mail server (第一名是 Exim) - Exim 自訂性高,可以根據需求進行複雜的設定 - Postfix 新手友善、容易配置 - 設計目標: - 兼容性 - 基本 100% 相容sendmail 的檔案 - 穩定性: - 在overload的情況下仍可以保正城市的可靠性,當沒有足夠的空間或記憶體的時後,postfix 會直接放棄,而不是重試 - 靈活性 - 由多個 module 組成,可依照需求安裝需要的 module - `apt search postfix | grep postfix` - 安全性 ### 安裝 - `sudo apt install postfix` - ![](https://i.imgur.com/IKGMhfC.png) - `No configuration` - `Internet site` 透過 SMTP 進行寄信,也可以收 local 內使用者互相寄的信 - 一般公司或單位用 - `Internet with smarthost` 要寄到外面的信件會經由其他 mail server 來轉發 - 想要透過外部server (google.com之類的) 幫忙寄信 - `Satellite system` local 內及外面的信件都由其他 mail server 轉發 - 跨國公司常用,假設主機在美國,可以透過其他地方的 Satelli Satellite System 來寄送 - `Local only`: 只有機內的使用者可以互相寄信 - 一般主機、家用電腦、測試用 - `sudo dpkg-reconfigure postfix` 看詳細設定檔 ( 直接看main.cf 也可以) - ![](https://i.imgur.com/FnIIDBU.png) - 這些 IP 可以直接寄信來我的 mail server >mail box size: 0 代表沒有上限 - Local address extension character - 表示忽略符號後的內容 - 可用於內部信件分流 > ta+squidxoxo@lsa.kija => ta@lsa.kija - `netstat -ntupl | grep :25` - 有看到 TCP 在聽 25 的話,恭喜你 postfix 安裝成功 ![](https://i.imgur.com/QBy0rxu.png) :::warning ### Postfix重要檔案/目錄 - `/etc/postfix/main.cf` 主要設定檔 - `myorigin =/etc/mailname` 希望用在 @ 後面的名稱 - 配置 SMTP 的 domain name - `myoringin` email 中 後面 @ 的部分,主機名稱 - 設定安裝這台postfix 的 SMTP 主機的名稱 - `inet_interfaces` SMTP 要聽的IP位置。all 代表聽所有的網路介面,如果有重複設定項目時,會以最晚出現的設定值為準 - `relayhost` 設定mail gateway (透過此mail gateway轉發) - `/ect/aliases` 信箱的別名,可以設成群組,一次寄給很多人 - `etc/mail/{username}` 收件匣 - `/var/mail/<username>` 裡面有收到的信件 ::: - 實作群組寄信 - `sudo postalias hash:/etc/aliasa` > 重新讀取 DB - `sudo service postfix reload` > 因為是 postfix 是 sever 的一種 > 需要更改設定後要 reload - telnet localhost(通過哪個 Mail Server 去寄) 25 - rcpt {要寄信過去的群組名稱} ### mbox & Maildir - mbox是個檔案,如果掛掉了,所有信件都會毀損 - 先看 `/var/mail` ,自己的信件紀錄 - 新增一個要拿來放 Maildir 的資料夾 - mbox to maildir `sudo apt install mb2md` - 不會用就看`man` - `sudo mbmd -s /var/mail/squidxoxo -d /var/mail/squidxoxo-dir` - 可以下載一個指令 `tree` 看資料 # FTP server ## ftp(file transfer protocol) ### history ![](https://i.imgur.com/kPM0GrO.png) >[圖片來源](https://www.geeksforgeeks.org/file-transfer-protocol-ftp-in-application-layer/) ### active mode - port mode - 由服務器主動發起傳送資料請求 - client 告訴 server 我會在哪個 port 做資料傳輸 - client 經過命令連線告訴 server 的 - server 主動去那個 port 建立資料連線(三向交握) - ![](https://i.imgur.com/HagkJ1J.png) > 21: 命令 port > 20: data port - BUT 很多在防火牆內的client 不被允許開啟某個Port 給他人連線 - 許多機器設置在防火牆內,只能透過防火牆有開啟的 port 與外部連線,在 active mode 下這些機器就不能主動開啟某個 port 給server 連線 ### passive mode 被動模式 - 服務器被動等待 client - server 開一個 port,被動等待 client 自己連上去 - server 經過命令連線告訴 client 他開了甚麼 port - Client 端主動向 Server 端建立連線並繼續完成三向交握 - ![](https://i.imgur.com/nF32Ikm.png) > client 利用 21(命令 port)來和 server 約定在某個 $>1024$ 的 port 來傳輸資料 :::info 自我檢測 - FTP 在 Client 與 Server 進行連線時,主要使用到的 port 有幾個?分別具有什麼用途? > 四個port 其中兩個進行命令連線,另外兩個做資料連線 > Client 會挑選一 >1024 隨機 port 啟動命令連線 > 命令連線通道的 ftp(預設為 port 21) > 資料連線傳輸的 ftp-data(預設為 port 20) > Client 再隨機挑選一 >1024 port 啟動資料傳輸 - client 與 sever進行FTP連線時,其模式分為active與passive,這兩種模式的差異為何? > active 與 passive 都是以sever的角度 > 主動式是以 server 當主體(簡單來講就是誰開port) - 當FTP架設在防火牆內部時,則這個FTP需要使用甚麼連線模式? > passive mode ( server 開 port ) > 因為在防火牆內的機器不能主動隨便開port > (由於 IP 分享器會將內部非法 IP 偽裝成 IP 分享器對外合法的 IP) - 如果希望防火牆支援 FTP,需要下甚麼指令? > 讓20、21port進來跟出去 ::: ## proftpd `sudo apt install proftpd` ### proftpd.conf - ServerType: 可以設為 inetd 與 standlone 其中之一 - standalone 持續運作在伺服器內,即時性較好;inetd 不持續運作,叫他會運作 :::success #### inetd - inetd(Internet Service Daemon) - 只有當其他人對他發出 request 才會運作,因此不需持續的執行他 ::: - TimeoutNoTransfer - 沒有傳輸的狀況下等多會time out - Modules.conf: 存放啟用的module看看 - `sudo service proftpd status`: 查看狀態 - `/etc/proftpd/proftpd.conf` : 設定檔位置 :::info #### LADAP - **L**ightweight **D**irectory **A**ccess **P**rotocol - 開放中立的工業標準的應用協定,通過ip協定提供存取控制和維護分散式資訊的目錄 - 存放層級/組織架構/權限/帳密的資料庫,提供查詢使用權限、可用功能 - 只要有設定權限,一組帳號密碼就能登入多個服務 - ![](https://i.imgur.com/VeHEJ7c.png) ::: - AllowOverwrite: 允許覆寫已存在的檔案 - DenyFilter: 指定 FTP 指令裡禁止使用的字串,格視為常規表示式 - Port: 指定伺服器使用的通訊埠,21 是 FTP 的標準通訊埠。如果把 Port 設為 0,表示關閉伺服器。 - Umask: 設定預設上傳檔案的權限遮罩 - anonymous(匿名登入): - 泛指不用帳密就可以登入的模式,就可以開啟匿名者權限,任何人都可以用這個權限登入 - 當使用 ftp client (如filezilla)不打帳密時,就會自動幫你填入 Anoymous 的帳號密碼 - default - user:anonymous - passwd:anonymous@domain.com - User, Group: 指定ProFTPd 伺服器執行所使用的帳號與群組。第16、17行舍為作業系統裡權限最低的nobody, nogroup - Maxlnstances: 指定伺服器可產生子行程的最大值。雖然他不等於,但會影響到可同時連線客戶端的最大數目 - 最多幾個動作 - < Anonumous ~ftp >設定匿名登入的相關設定 ### log - 位置: `/var/log/proftpd` - `proftpd.log`: 登入者的資訊 - `ftp {username}@ip` > ftp 因為是明文傳輸所以傳輸速率是最快的 > 想要加密可以使用 TLS 或使用 ssl(local tunnel)的方式將管理的通道加密 > 使用 local tunnel 來加密的話只會有命令被加密(訊息沒有加密),所以如果想要全部都被加密就使用 TLS 比較快 ## ftp vs ftps vs sftp - FTP(file transport port) - 明文傳輸 - 使用 21 port 作為命令通道,讓主從雙方先握手建立連線 ACK x SYN 驗證,再依照是否啟用被動模式決定是否傳送 PASV 或指定 port 來確認資料傳輸 port(通常是20),接著就開始進行 STOR 下載檔案或 RETR 傳送檔案,最後使用 FIN 來結束連接(以上通訊內容全部都是明文) - FTPS (FTP over SSL/TLS) - 內文先加密後,再經過 FTP 去傳輸 - 透過安全通訊端層(SSL)或TLS通訊協定,讓檔案傳輸受到加密保護,減少不必要風險 :::info ### TLS - Transport Layer Security - SSL 的後繼協議 - 1999年IETF將SSL標準化,改名為TLS,而TLS 1.0也可支援相容SSL 3.0的功能 - TLS hankshake - 在tcp三向交握後進行 - 指定他們將使用的TLS版本(TLS 1.0、1.2、1.3等) - 指定他們將使用的密碼套件 - 通過伺服器的公開密鑰和SSL憑證頒發機構的電子簽名驗證伺服器的身分 - 生成工作階段金鑰,以便在握手完成後使用對稱加密 ::: - SFTP(SSH File Transport Port) - 加密傳輸管道 - 透過 Secure Shell(SSH),在通道內建立檔案傳輸 # 備份 ## 備份是甚麼? :::info **好的備份需要滿足條件**: 1. 可以保留這份檔案先前的版本 2. 至少要有一份異地備分 3. 使用多種備份解決方案 4. 可以進行測試還原,確保能正常還原 5. 還原的時候可以有選的還原(為了還原一份檔案,不需要去還原整份備份,或可以選擇要還原的版本) 6. 備份檔案要可以打開並查閱 7. 在備份前要想到所有可能的事故,並且都能有有效處理方案 > 備份的重點是要能夠回朔 > [name=BT] ::: :::danger **所有不知道如何還原所有內容的方法都不能稱為好備份** ::: - 基本的備份策略: - 3-2-1 備份 - 3 份資料 (備份三份) - 2 種不同類型的儲存媒體 - 1 分資料離地保存 (資料要存在不同的地方) ![](https://i.imgur.com/28cJCgQ.png =300x) > 世界備份日 3/31 ## 備份類型 ### 完整備份 - 將全部檔案進行一次性的備份 - 例如: - 將某個磁碟分割區內容的所有檔案進行備份 - 將硬碟內所有磁碟區內的檔案進行一次性的快照並備份 ### incremental 增量備份 - 根據第一次完整備份或最後一次備份,備份已更改和新添加的數據 ![](https://i.imgur.com/jCoRQYL.png) ### Differential 差異備份 ![](https://i.imgur.com/NI11WLn.png) - 僅保存從上次完整備份後更改的檔案數據 - 要還原時? - 先從最近的完整備份 - 加上最近的差異備份 - 優點: - 節省每次進行完整備份所消耗的大量儲存空間 - 缺點: - 當資料檔案壞掉了,要復原最後一份差異備份時,要依序將每一份定期的備份逐一檢查 | | 全部備份 | 增量備份 | 差異備份 | | -------- | -------- | -------- | -------- | | 備份時間 | 長 | 短 | 中 | | 復原檔案 | 最近一次全部備份 | 上一次全部備份 + 之後每一次的增量備份 | 上一次全部備份 + 最近一次差異備份 | :::info ### Near-CDP - continuous data protection - 可以保存對資料的所做的更改副本,以此便能 - 將每次做的紀錄都寫進 log 中 - Near-CDP - 和 CDP 類似 - 以定期時間進行增量備份 - 無法恢復任何時間點 - 比 CDP 更加實用,不受運行方式限制 | | CDP | Near CDP | | -------- | -------- | -------- | | 價格 | 高 | 低 | | 需要時間 | 少(數秒) | 多(數分)| | 一般應用 | 線上交易、拍賣網站 | 資料庫、電子郵件伺服器 | | 備份頻率 | 每次寫入 | 一段時間一次(一半是半小時或15分鐘) | | 特點 | 需要搭配虛擬機或其他等校軟體的運行,適合企業 | 有熱備份能力、但只需要冷備份價格、節省磁碟空間 | ### 冷備份、熱備份 - 冷備份: 系統處於停機狀態或維護狀態下的備份,這種期況下,備份的資料與系統中此時段的資料完全一致 - 熱備分: 系統處於正常狀態下的備份,這種情況下,由於系統中資料可能隨時在更新,備份的資料相對於系統的真實資料可能有一定滯後 | 種類 | 冷備份 | 熱備份 | | -------- | ------ | ------ | | 資料恢復 | 任意時間點 | 備份時間點 | | 效能 |少許降低 | 少許提高 | ::: :::info ### DRsite - 針對災難發生時做的一些對策,災難包括 - 地震或火災 - 技術故障 - 系統不相容 - 簡單的人為錯誤 - 第三方蓄意未經授權存取 (中毒) #### MTD, RTO, PRO - 最大可容忍的停機時間 ( **M**aximum **T**olerable **D**owntime,MTD) 災難發生後,系統最晚要在此時間復原,在此時間後還沒復原,公司可能鄒受巨大損失 - 恢復時間目標(Recovery Time Objective,RTO) 是災難發生後必須是回覆系統的最早時間,通常小於MTD(因為 MTD值表示無法恢復將公司聲譽或底線造成嚴重甚至可能無法彌補的損失時間) - 恢復點目標(Recovery Point Objective) 是按時間衡量的可接受的資料遺失。 此值表示必須恢復資料的最早時間點。 RPO 是指可以從同一事件中丟失的,按照時間衡量的可接受的資料量。 ::: ### 常用備份指令 #### mysqldump :::info #### MariaDB 與 MySQL 的愛恨情仇 ![](https://i.imgur.com/lu1AKE1.png) ![](https://i.imgur.com/xY8iHWK.png) ::: :::info 在安裝的時候(例如:::apt或yum install)找不到以MariaDB開頭的函式庫或輔助程式的時候,可以嘗試用MySQL為開頭去找,因為很多程式其實是共用的。 ::: - 全備份 ```= mysqldump -u(使用者) root -p(密碼) --all-databases > all_db_backup.sql mysqldump -u root -p -B file > file.sql ``` - 讀檔 ```= mysql -u username -p < all_db_backup.sql mysql -u username -p database_name < file.sql ``` - binlogs (Binary Log) - 以binary方式儲存的log - 此方法會把所有會變動到資料的指令除存到 binlog ,其中包含 CREAT, ALERT, TABLE - 首先要還原最近一次的full backup ,然後恢復 | 比較 | 只用全備份 | 全備份+binlogs | | ---- | -------- | -------- | | 版本 | 只能以每次備份做控制 | 任何會改變資料庫的動作都會被記錄,可以自由調整 | | 針對資料庫速度影響| 備份的瞬間會有大影響 | 一直都會有小影響 | - 讀取 ```= PURGE BINARY LOGS TO 'mysql-bin .00002'; ``` ```= # 指定時間點做復原 PURGE BINARY LOGS BEFORE '2099-01-01 09:55:22'; ``` #### rsync - scp :可以異地複製貼上 - rsync :可以異地複製**比較**貼上 | 比較 | scp | rsync | | -------- | -------- | -------- | | 複製方法 | 全備份 | 差異備份 | | 斷線 | 重頭開始 | 繼續比較,不用重頭 | | 預設port | 22(ssh) | 873 | | 速度 | 第一次速度一樣,之後較慢 | 第一次速度一樣,之後較快 | 用法 -a 權限保存模式 : 忽略現有檔案 :::info deja sudo apt install automysqlbackup //截圖證明有玩過 :::

    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