林博仁 Buo-ren Lin
    • 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
    # SSH 服務公鑰指紋主題之 gpt-4-turbo 大語言模型(LLM)對話紀錄快照 留作未來參考用 ## 內容大綱 [TOC] ## Which part of the server key does the SSH client determine the fingerprint from? The SSH client determines the fingerprint of a server by using the public key part of the server's key pair. The public key is provided to the client during the SSH handshake process, specifically during the server authentication phase. Here's a simplified explanation of the steps involved: 1. **Initiation**: When initiating a connection, the SSH client contacts the server, and they exchange information including what versions of SSH they are using and what encryption algorithms they support. 2. **Key Exchange**: During the key exchange process, the server sends its public key to the client as part of proving its identity. 3. **Generation of Fingerprint**: The client then generates a fingerprint from this public key. This fingerprint is typically a hash value created from the public key using hashing algorithms like SHA-256. The purpose of generating a fingerprint is to provide a shorter, more manageable representation of the public key that can be easily verified or compared. 4. **Verification** (optional but recommended): In a typical first connection scenario, the client alerts the user of the key fingerprint and asks for confirmation. The user should verify this fingerprint against a trusted source or known value to confirm authenticity. If it matches a known or trusted fingerprint, the client can store this key and fingerprint pair for future connections to the server. Thus, the fingerprint helps in verifying the identity of the server by providing a human-readable form of the server's cryptographic identity (its public key), which is crucial for securing the connection against "Man-in-the-Middle" attacks. Each time the client connects to the server, it can check whether the server’s public key matches the fingerprint it has saved from previous sessions or received through a trusted channel. If the fingerprint mismatches, the SSH client warns the user of a possible security risk. ## How to determine the key fingerprints on the server? To determine the key fingerprints on an SSH server, you typically need to access the server and compute the fingerprint of the public key files used by the server for SSH connections. Here is how you can do it on a typical Linux server where SSH (Secure Shell) is set up: 1. **Locate SSH Public Key Files:** SSH public keys are usually located in `/etc/ssh/`. For each type of key (RSA, DSA, ECDSA, ED25519), there will be a corresponding public key file. For example: - `/etc/ssh/ssh_host_rsa_key.pub` - `/etc/ssh/ssh_host_ecdsa_key.pub` - `/etc/ssh/ssh_host_ed25519_key.pub` Note: The actual location and availability of these files might vary based on your server configuration and the SSH server software used. 2. **Generate Fingerprints:** To generate the fingerprint from each public key file, you can use the `ssh-keygen` tool. Here's how you can do it for a typical RSA public key: ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub - `-l` means "show the fingerprint". - `-f` specifies the filename of the key file. This command will output something like: 1. 2048 SHA256:NhXWvXsiBxB5Lxo9E/WqVQCRIhRmVoZ1R9CorjQdcC8 root@hostname (RSA) The output format includes the bit size of the key, its fingerprint (in this case, using the SHA256 hashing algorithm), the identity of the user who generated the key, and the key algorithm. 2. **Repeat for Other Keys:** You might want to repeat step 2 for other types of keys (like ECDSA and ED25519) depending on which protocols are enabled and used by your SSH server. 3. **Automate and Document:** If you manage multiple servers or need to document or regularly update key fingerprints, consider scripting the generation of fingerprints across your servers, and securely store these values for future verification. Remember the importance of keeping these keys secure. Anyone with access to your private keys (not the public parts or fingerprints, but the actual private keys) can potentially impersonate your server or decrypt secured communications. Always ensure proper permissions are set on your key files to prevent unauthorized access. ## How to query the key fingerprint in another hashing algorithm? To generate and query SSH key fingerprints in another hashing algorithm using the SSH `ssh-keygen` tool, you can specify a different hash algorithm by using the `-E` option followed by the name of the hash algorithm. Common choices for hash algorithms include `md5` and `sha256`, although `md5` is generally deprecated due to security vulnerabilities. Here’s how you can query the key fingerprint using a specific hash algorithm: ### Step 1: Determine Available Hash Algorithms `ssh-keygen` supports different hashing algorithms, primarily `sha256` and `md5`. You can explicitly specify which one to use: - `sha256`: This is the default in most modern systems for its stronger security compared to `md5`. - `md5`: This is older and less secure but is sometimes used for compatibility purposes. ### Step 2: Generate Fingerprints with a Specific Hash Algorithm To generate a fingerprint using a specific hash algorithm, use the command format as follows: ssh-keygen -l -E [hash-algorithm] -f /etc/ssh/[public-key-file] Replace `[hash-algorithm]` with your choice (`sha256` or `md5`), and `[public-key-file]` with the path to the specific SSH public key file you are examining. #### Example: Using SHA256 ssh-keygen -l -E sha256 -f /etc/ssh/ssh_host_rsa_key.pub #### Example: Using MD5 ssh-keygen -l -E md5 -f /etc/ssh/ssh_host_rsa_key.pub This will produce output showing the fingerprint of the key in the specified algorithm format, like so: - For SHA256: - 2048 SHA256:NhXWvXsiBxB5Lxo9E/WqVQCRIhRmVoZ1R9CorjQdcC8 root@hostname (RSA) - For MD5: - 2048 MD5:01:23:45:67:89:ab:cd:ef:01:23:45:67:89:ab:cd:ef root@hostname (RSA) ### Step 3: Verify and Document Confirm and document the fingerprints as required. Always use the most secure and recommended hash algorithm available (preferably `sha256`) unless specific compatibility issues dictate otherwise. ### Note: Align the hash algorithms If you face compatibility issues or need to share fingerprint information with systems that use a different default hashing standard, you must align the hash algorithms accordingly. Always ensure that usage of `md5` is phased out where possible due to its known vulnerabilities. ## How to determine the key fingerprints on a server that uses the Dropbear SSH server implementation? Accessing and determining key fingerprints on a server using the Dropbear SSH daemon is somewhat different from working with systems that use OpenSSH. Dropbear is a lightweight SSH server and client used commonly in environments like embedded systems. Here’s how you can determine the fingerprints of SSH keys on a system running Dropbear: ### Step 1: Locate the SSH Key Files Dropbear maintains its SSH key files often in different locations than OpenSSH, depending on the configuration during installation. Common default locations include: - `/etc/dropbear/` - `/etc/dropbear.d/` Look for files that might be named like `dropbear_rsa_host_key`, `dropbear_dss_host_key`, or `dropbear_ecdsa_host_key`. ### Step 2: Generate Fingerprints from Dropbear Public Keys Dropbear prior to version 2020.80 did not have a built-in method for generating fingerprints directly from command line like `ssh-keygen` in OpenSSH does. For these versions, you may need to convert Dropbear public key formats to OpenSSH format or use external tools to calculate the hash. However, recent Dropbear has added some utility for this: #### Using `dropbearkey` on newer versions: If your version of Dropbear includes this feature (2020.80 and later), you can use the `dropbearkey` command to show the fingerprint directly: dropbearkey -y -f /etc/dropbear/dropbear_rsa_host_key This command will show key parameters and fingerprint, which might look like the following: Public key portion is: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABA... Fingerprint: md5 64:6a:64:ce:72:3d:c6:df:48:8b:b8:59:2f:14:be:b3 #### For older versions of Dropbear or a manual approach: 1. **Use `dropbearconvert` to convert Dropbear key to OpenSSH format**: First, convert the key format: - dropbearconvert dropbear openssh /etc/dropbear/dropbear_rsa_host_key /tmp/openssh_rsa_host_key - **Then use OpenSSH's `ssh-keygen` to generate the fingerprint**: 1. ssh-keygen -l -f /tmp/openssh_rsa_host_key.pub ### Step 3: Repeat for Other Keys If you have other keys (like ECDSA or Ed25519), repeat the process for each key file to generate and document the fingerprints as needed. ### Notes It is critical to ensure you know the exact location and format of the SSH keys used by Dropbear on your server, as custom builds and configurations can change defaults significantly. Always verify that you are accessing the correct files and using the methods compatible with your version of Dropbear. If working in sensitive environments, consider additional security practices such as key rotation and auditing access logs. ## How to query the server's public key fingerprints at the client side? To query and verify the server's SSH public key fingerprints from the client side, you can use several approaches, depending on whether it is your first time connecting to the server or if you have already established trust with the server in the past. Here's how you can handle both scenarios: ### First Connection to the Server When you connect to an SSH server for the first time, the client receives the server's public key and presents you with the fingerprint so that you can verify its authenticity. This happens automatically as part of the SSH connection process. Here’s how to do it: 1. **Initiate a Connection**: Open your terminal and use the `ssh` command to connect to the server: - ssh username@hostname Replace `username` with your actual user name and `hostname` with the server’s IP address or domain name. - **Verify the Fingerprint**: On your first connection attempt, you will see a message similar to the following: 1. The authenticity of host 'hostname (IP address)' can't be established. ECDSA key fingerprint is SHA256:xxxxxxxxxxx. Are you sure you want to continue connecting (yes/no/[fingerprint])? This shows the fingerprint of the server's public key. Before typing `yes`, you should verify this fingerprint by comparing it to a trusted source or by directly contacting the server administrator. ### Subsequent Connections For subsequent connections, SSH automatically verifies the server's fingerprint against the one stored in your `~/.ssh/known_hosts` file. If the fingerprint has changed (which could indicate a potential security threat like a man-in-the-middle attack), SSH warns you about this change. ### Manually Querying the Server's Public Key Fingerprint If you want to manually query and view the fingerprint of the server's public key without actually making a connection, you can use the `ssh-keyscan` tool: 1. **Use ssh-keyscan**: - ssh-keyscan -t rsa,ecdsa hostname Replace `hostname` with your server’s actual hostname or IP address. This command scans the SSH server’s keys. - **Pipe ssh-keyscan Output to ssh-keygen**: To get the fingerprint in a readable format, you can pipe the output from `ssh-keyscan` to `ssh-keygen -lf -`: 1. ssh-keyscan -t rsa hostname | ssh-keygen -lf - Here, `-l` shows the fingerprint and `-f -` tells `ssh-keygen` to read from standard input. ### Note It’s crucial to verify the server's fingerprint against a reliable and trusted source, especially for initial connections. For automated or scripting environments, ensure that your scripts handle fingerprint verifications correctly to prevent security risks. This approach allows you to proactively manage and verify SSH key fingerprints, ensuring secure connections to your servers. ## How to verify the dropbear service's fingerprint using OpenSSH client? To verify the fingerprint of a Dropbear SSH server service using an OpenSSH client, you need to follow a process similar to handling any SSH server, but with special attention given to the fact that the server runs Dropbear instead of OpenSSH. Here’s how to manage the verification: ### Step 1: Connect to the Server When you connect for the first time with an OpenSSH client to a Dropbear SSH server, the client will display a fingerprint prompt similar to any SSH connection. To initiate the connection, run: ssh username@hostname Replace `username` with your user name on the server and `hostname` with the server's IP address or domain name. ### Step 2: Fingerprint Verification Upon your first connection attempt, you'll see a message like: The authenticity of host 'hostname (IP address)' can't be established. RSA key fingerprint is SHA256:xxxxxxxxxxx. Are you sure you want to continue connecting (yes/no/[fingerprint])? This message displays the fingerprint of the Dropbear server’s public key that you need to verify. Before you proceed by typing `yes`, you should: - **Verify the fingerprint against a trusted source**: This could be a record provided by your organization, the server administrator, or through other secure means. The fingerprint displayed should match the fingerprint you independently obtain or verify from trusted records. ### Step 3: Manual Verification (Optional) If you want to manually retrieve and verify the fingerprints of the Dropbear service independently from a connection attempt, use the `ssh-keyscan` tool which is part of OpenSSH: ssh-keyscan -t rsa,ecdsa hostname > serverkeys You'd replace `hostname` with the actual hostname or IP address of your Dropbear server. This command fetches the public keys presented by the SSH server. Next, verify the fingerprints: ssh-keygen -lf serverkeys This command will output the type, fingerprint, and other details of the keys stored in the `serverkeys` file. Compare these fingerprints against your trusted sources. ### Important Notes 1. **Ensure Security**: The manual retrieval and verification of keys using tools like `ssh-keyscan` should be done over a secure network to avoid interception by malicious parties. 2. **Network Security Considerations**: If there's ever a discrepancy in the fingerprints (i.e., the fingerprint doesn't match what you expect), it may indicate a potential security threat such as a Man-in-the-Middle attack. Investigate discrepancies seriously before proceeding. 3. **Fingerprint Formats**: Be aware that different SSH implementations and different versions may represent fingerprints in differing formats (e.g., Hex vs. Base64). Make sure you understand the format used when comparing. By following these steps, you can verify the fingerprint of a Dropbear server using an OpenSSH client, ensuring that you are connecting to a genuine server and thereby reducing the risk of security issues. ## How to fix-up the unmatched SSH key fingerprint representation between the `dropbearkey -y` command and the `ssh-keyscan` command? To ensure the fingerprints from `dropbearkey -y` and `ssh-keyscan` output match, we must first understand the different formats they are using. The output from `dropbearkey` uses SHA1 with a Hexadecimal representation, while `ssh-keyscan` followed by `ssh-keygen` outputs SHA1 in Base64 encoding. Here are the steps to verify and compare these fingerprints properly: ### Step 1: Normalize the Output Format First, we need to ensure that both outputs are in the same format. Since converting from Base64 to Hex is more straightforward, let's convert the SHA1 Base64 fingerprint from `ssh-keyscan` into Hexadecimal format. 1. **Convert the Base64 fingerprint to Hex**: - Take the Base64 encoded SHA1 fingerprint part `pR9x70YXFQU/U0KPPhp0JwHZ7cU` (ignoring the initial '256 SHA1:') - Decode it from Base64 to binary. - Convert the binary digest to Hexadecimal. Here's how you could do this in Python: import base64 # SHA1 Base64 Fingerprint obtained from ssh-keygen via ssh-keyscan base64_fingerprint = "pR9x70YXFQU/U0KPPhp0JwHZ7cU" # Decode base64 to binary binary_fingerprint = base64.b64decode(base64_fingerprint) # Convert binary to hex and format appropriately hex_fingerprint = ':'.join(f"{byte:02x}" for byte in binary_fingerprint) print("Fingerprint in Hex:", hex_fingerprint) ### Step 2: Compare the Fingerprints Run the Python script above (or equivalent in another programming language you are comfortable with) to convert the fingerprint you received from `ssh-keyscan > ssh-keygen` into Hex format. You should now have a Hexadecimal representation similar to what `dropbearkey -y` outputs. ### Step 3: Verify Matches Compare the Hex fingerprint from the Python script (or your method) with the one outputted by `dropbearkey -y`. If both normalized fingerprints match, then it confirms that the key fingerprints are the same. If they do not, then the keys might be different or there's a possible intercept threat. ### Notes: - The example script provided above uses Python's built-in libraries `base64` to handle the conversion. Ensure your environmental setup can run Python scripts if you choose this method. - Always ensure you're performing these actions in a secure environment to prevent potential interception or other security risks. - Converting and comparing cryptographic hashes manually is usually done only during setups, troubleshooting, or security auditing. For routine connections, relying on SSH's built-in handling of key verification is sufficient unless you suspect security issues. ## How to do that using shell commands? To convert and match SSH key fingerprints using shell commands, you can use common utilities like `openssl`, `echo`, `xxd`, and `base64`. Here, I'll outline how to replicate the steps described previously for converting a Base64 encoded fingerprint into hexadecimal format and then comparing it using shell commands. ### Step 1: Base64 to Hexadecimal Conversion Given a Base64 encoded fingerprint from `ssh-keyscan` and `ssh-keygen`, you'll first decode it to binary, then convert that binary to Hexadecimal, and finally format it for comparison. Assume you have the following Base64 fingerprint from the earlier steps: pR9x70YXFQU/U0KPPhp0JwHZ7cU #### Convert Base64 to Hexadecimal Format 1. **Decode Base64 to Binary, Convert to Hexadecimal**: Use `echo`, `base64`, and `xxd` utilities: echo "pR9x70YXFQU/U0KPPhp0JwHZ7cU" | base64 --decode | xxd -p 2\. **Format the Hex Output**: You can format the hexadecimal output to match the style (`a5:1f:71:...`) using `sed`: echo "pR9x70YXFQU/U0KPPhp0JwHZ7cU" | base64 --decode | xxd -p | sed 's/../&:/g;s/:$//' This command sequence performs the following: - `echo "..."` sends the base64 string to stdout. - `base64 --decode` decodes the output from base64 encoding to binary. - `xxd -p` outputs the binary content in plain hex format. - `sed 's/../&:/g;s/:$//'` inserts a colon between every two characters and removes the last colon. ### Step 2: Compare the Fingerprints Now, compare the resulting hexadecimal fingerprint from the command output with the fingerprint implicitly given or queried from the `dropbearkey -y` command. You should arrange to have both of them displayed or outputted simultaneously for visual comparison, or use a shell command to compare: FINGERPRINT1=$(echo "pR9x70YXFQU/U0KPPhp0JwHZ7cU" | base64 --decode | xxd -p | sed 's/../&:/g;s/:$//') FINGERPRINT2="a5:1f:71:ef:46:17:15:05:3f:53:42:8f:3e:1a:74:27:01:d9:ed:c5" if [ "$FINGERPRINT1" == "$FINGERPRINT2" ]; then echo "Fingerprints match." else echo "Fingerprints do not match." fi This approach ensures you're comparing the exact fingerprints from the server and the values you calculated, enabling you to verify the authentic identity of the SSH server. This is particularly useful when manually verifying fingerprints during initial server setups or security audits. ## The Python script in step 1 resulted in the following error output: `binascii.Error: Incorrect padding`. How to fix it? The error `binascii.Error: Incorrect padding` that you encountered in Python typically arises when decoding Base64 content and the string length is not a multiple of four. Base64 encoding requires the input length to be evenly divisible by four. It is often padded with one or two `=` characters at the end to ensure the encoded string's length meets this requirement. To resolve this error, you can add the necessary padding manually if it's missing, and then proceed with the decoding. I'll update the Python script to handle cases where padding might be missing. ### Updated Python Script to Handle Padding: import base64 # Base64 fingerprint obtained base64_fingerprint = "pR9x70YXFQU/U0KPPhp0JwHZ7cU" # Ensure the string length is a multiple of 4 by adding required '=' padding pad_len = len(base64_fingerprint) % 4 if pad_len: # pad_len is 1, 2 or 3 base64_fingerprint += '=' * (4 - pad_len) # Now decode base64 to binary binary_fingerprint = base64.b64decode(base64_fingerprint) # Convert binary to hex and format appropriately hex_fingerprint = ':'.join(f"{byte:02x}" for byte in binary_fingerprint) print("Fingerprint in Hex:", hex_fingerprint) This script first checks if the length of the Base64 encoded string is divisible by 4. If it's not, it appends the necessary number of `=` characters to make it so. This helps in ensuring that the Base64 string is correctly padded before decoding and thus prevents the `Incorrect padding` error. You should now run this revised script with your specific Base64 fingerprint value. This approach ensures that the script works even if some tools that provide or log Base64 encoded strings do not properly pad them, which can often occur in real-world scenarios. ### Explanation of Script Changes: - **Padding Calculation**: `pad_len = len(base64_fingerprint) % 4` calculates how many characters are needed to make the string's length a multiple of four. - **Conditional Padding**: `if pad_len: base64_fingerprint += '=' * (4 - pad_len)` adds one to three `=` signs to the end of the string if necessary. - **Decoding**: `base64.b64decode(base64_fingerprint)` now works without the error since the input string has been properly padded. By handling the padding directly within the script, you ensure more robust processing especially in automated environments or scripts where the input might not always be perfectly formatted.

    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