KangMoo
    • 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 New
    • 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 Note Insights Versions and GitHub Sync 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # SSH와 SCP ## SSH(Secure Shell) ### SSH란? SSH는 Secure Shell의 약자이다. 네트워크 프로토콜 중 하나로, 불안전한 네트워크를 통해 원격 컴퓨터에 안전하게 접근하고 명령을 실행할 수 있게 해주는 프로토콜이다. 주로 리눅스나 맥 같은 유닉스 기반 시스템에서 사용한다. ### SSH의 주요 기능 - 원격 제어 : 사용자는 로컬 컴퓨터에서 원격 컴퓨터로 접속해 명령어를 실행할 수 있다. - 데이터 암호화 : 전송되는 모든 데이터는 암호화되어 네트워크를 통해 보안을 유지한다. - 인증 메커니즘 : 비밀번호 인증, 공개 키 인증 등 다양한 인증 방식을 지원한다. ### SSH의 작동 원리 SSH 연결 과정은 크게 세 단계로 이루어진다 1. 암호화된 채널 설정 : 클라이언트와 서버 간에 암호화된 채널을 생성한다. 2. 서버 인증 : 클라이언트가 서버의 신뢰성을 검증한다. 3. 사용자 인증 : 사용자가 서버에 접속할 수 있음을 인증한다. #### 예제: SSH로 서버에 접속하는 방법 (비밀번호 인증) ```bash ssh [사용자명]@[서버 주소] ``` 이 명령어를 사용하면 사용자명과 서버 주소에 해당하는 원격 컴퓨터에 접속을 시도한다. 예를 들어, 사용자명이 `ubuntu`이고 서버 주소가 `192.168.1.1`인 경우 다음과 같이 입력한다. ```bash ssh ubuntu@192.168.1.1 ``` #### 예제: SSH로 서버에 접속하는 방법 (포트 지정) SSH는 기본적으로 22번 포트를 사용한다. 다른 포트를 사용하려면 `-p` 옵션을 사용한다. ```bash ssh -p [포트 번호] [사용자명]@[서버 주소] ``` #### 예제: SSH로 서버에 접속하는 방법 (공개 키 인증) 공개 키 인증을 사용하려면 먼저 클라이언트에서 공개 키를 생성하고 서버에 등록해야 한다. 공개 키를 생성하려면 다음 명령어를 사용한다. ```bash ssh-keygen -t rsa ``` 이 명령어를 실행하면 `~/.ssh/id_rsa`와 `~/.ssh/id_rsa.pub` 파일이 생성된다. `id_rsa` 파일은 개인 키, `id_rsa.pub` 파일은 공개 키이다. 공개 키를 서버에 등록하려면 다음 명령어를 사용한다. ```bash ssh-copy-id [사용자명]@[서버 주소] ``` 이 명령어를 실행하면 공개 키가 서버에 등록되어 비밀번호 없이 SSH로 접속할 수 있다. #### 예제: SSH로 서버에 접속하는 방법 (키 파일 지정) `-i` 옵션을 사용하여 특정 키 파일을 지정할 수 있다. ```bash ssh -i [키 파일 경로] [사용자명]@[서버 주소] ``` ### SCP(Secure Copy Protocol) ### SCP란? SCP는 SSH의 보안 기능을 기반으로 파일을 안전하게 전송하는 프로토콜이다. 네트워크를 통해 두 호스트 간에 파일을 복사할 때 사용한다. ### SCP의 주요 기능 - 파일 복사 : 원격 호스트와 로컬 호스트 간에 파일 또는 디렉토리를 복사한다. - 보안 전송 : SSH 프로토콜을 이용하여 데이터를 암호화하여 전송한다. ### SCP의 사용 방법 #### 파일을 원격 호스트로 복사하기 ```bash scp [로컬 파일 경로] [사용자명]@[서버 주소]:[원격 파일 경로] ``` 예를 들어, 로컬 컴퓨터의 `example.txt` 파일을 원격 서버 `192.168.1.1`의 `/home/ubuntu/` 디렉토리로 복사하려면 다음과 같이 실행한다. ```bash scp example.txt ubuntu@192.168.1.1:/home/ubuntu/ ``` #### 파일을 로컬 호스트로 복사하기 ```bash scp [사용자명]@[서버 주소]:[원격 파일 경로] [로컬 파일 경로] ``` 예를 들어, 원격 서버 `192.168.1.1`의 `/home/ubuntu/example.txt` 파일을 로컬 컴퓨터의 현재 디렉토리로 복사하려면 다음과 같이 실행한다. ```bash scp ubuntu@192.168.1.1:/home/ubuntu/example.txt ./ ```

    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