sublime text3 のstfpを使ってサーバーにつなぐ

  1. sftpとは

sshで暗号化された通信路を使って安全にファイルを送受信するプロトコル
また、それを利用してUNIXなどで暗号化ファイル送受信を行うコマンド。

  1. localへのつなぎ方

1 sublime text3にsftpをインストール

「tools > command pallete」 → 「Package Control: install Package」→「「sftp」と検索」

2 公開鍵の用意

3 sshのconfig設定

4 sublime text3にsftp-config.jsonの作成

「files > SFTP/FTP」→ 「Setup Server」

 // sftp, ftp or ftps
    "type": "sftp",

    "save_before_upload": true,
    "upload_on_save": true,
    "sync_down_on_open": false,
    "sync_skip_deletes": false,
    "sync_same_age": true,
    "confirm_downloads": false,
    "confirm_sync": true,
    "confirm_overwrite_newer": false,
    
    "host": "sftp.server",
    "user": "sftp_user",
    "password": "password",
    "port": "22",
    
    "remote_path": "/path/to/sftp_pfoject/",
    "ignore_regexes": [
        "\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
        "sftp-settings\\.json", "/venv/", "\\.svn/", "\\.hg/", "\\.git/",
        "\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
    ],
    //"file_permissions": "664",
    //"dir_permissions": "775",
    
    //"extra_list_connections": 0,

    "connect_timeout": 180,
    //"keepalive": 120,
    //"ftp_passive_mode": true,
    //"ftp_obey_passive_host": false,
    "ssh_key_file": "~/.ssh/id_rsa",
    //"sftp_flags": ["-F", "/path/to/ssh_config"],
    
    //"preserve_modification_times": false,
    //"remote_time_offset_in_hours": 0,
    //"remote_encoding": "utf-8",
    //"remote_locale": "C",
    //"allow_config_upload": false,

5 サーバーに接続

「SFTP/FTP > Sync Remote -> sync Remote -> local」