使用sublime text 3连接到openshift ftp

时间:2016-03-13 06:56:23

标签: openshift sublimetext3 sftp

使用sublime text连接到openshift ftp 3.我已经尝试过使用SFTP插件。这是我的配置文件:

{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help

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

"sync_down_on_open": true,
"sync_same_age": true,

"host": "nodebb-htforum.rhcloud.com",
"user": "56d3d2e189f5cfad110001a1",
"password": "******",
"port": "22",

"remote_path": "/",
//"file_permissions": "664",
//"dir_permissions": "775",

//"extra_list_connections": 0,

"connect_timeout": 30,
//"keepalive": 120,
"ftp_passive_mode": true,
//"ftp_obey_passive_host": false,
"ssh_key_file": "C:/Users/Nihal/.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,
}

1 个答案:

答案 0 :(得分:1)

要使用Sublime Text的sftp连接到OpenShift,您可以按照以下步骤操作:

1. Install Client tools (on windows):
    https://developers.openshift.com/getting-started/windows.html#client-tools

    * If you using MacOS: Only install rhc:
        $ sudo gem install rhc 

        If you get the "Operation not permitted" (EPERM) error, run instead:
        $ sudo gem install -n /usr/local/bin rhc

        If you encounter any dependency issues, you may need to run:
        $ sudo gem update

2. Create RSA Key:

    rhc setup

    You’ll be prompted for your OpenShift username and password:
        Login to openshift.redhat.com: Your email (user@example.com)
        Password: Your password

 follow the steps setup to create private key and public key. this step too upload public key to Your OpenShift App.

3. Config sftp connect to OpenShift App:
All Os can use:

    type: sftp
    Host: [your app name]-[your openshift domain].rhcloud.com
    User: App ID (https://openshift.redhat.com/app/console/application/687ac8fd0c1e665b5300011b-[your app name] => app id is: 687ac8fd0c1e665b5300011b)

    remote_path: /var/lib/openshift/your app id/app-root/repo/php/ (for php  app or wordpress app: /var/lib/openshift/your app id/app-root/data/current)

3.1 For Linux and MacOS use sftp need rsa key:
    Pass: password login to OpenShift)
    Port: 22
    ssh_key_file: "~/.ssh/id_rsa"

3.2 For Windows Sublime Text use psftp need private key:
    //Pass: (not use)
    //Port: 22 (not use)
    ssh_key_file: "C:\\Users\\Your username\\.ssh\\your private key.ppk" (More Step 4)
  1. 如何使用公钥创建私钥Puttygen

    Download and Open Puttygen then click on Generate button and move mouse to complete public key.
    
    Kick on Save private key button and Save to C:\Users\Your username\.ssh\your name private key.ppk
    
    On Openshift at Settings tab kick Add a new key and paste public key just create at Puttygen to key content on Opnshift.
    
  2. 本教程使用Linux,MacOS和Windows进行Sublime Text 2,3。

    最终:项目文件夹上的鼠标右键=> SFTP / FTP =>浏览远程。

    完成!