2017-08-25 52 views
0

我想在远程编辑EC2中的文件,我花了一段时间来设置config.json但我仍然有超时错误。 我使用Mac和我已经chmod 400.pem文件在EC2上使用Sublime3 SFTP

{ 
"type": "sftp", 
"sync_down_on_open": true, 
"host": "xxx.xx.xx.xxx", 
"user": "ubuntu", 
"remote_path": "/home/ubuntu/", 
"connect_timeout": 30, 
"sftp_flags": ["-o IdentityFile=/Users/kevinzhang/Desktop/zhang435_ec2.pem"], 
} 

回答

0

我看着办吧,以防万一人也有同样的问题 我使用的是Mac OS 安装了Ubuntu

的配置文件是有被貌似

{ 
// 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", 

// "save_before_upload": true, 
"upload_on_save": true, 
"sync_down_on_open": true, 
"sync_skip_deletes": false, 
"sync_same_age": true, 
"confirm_downloads": false, 
"confirm_sync": true, 
"confirm_overwrite_newer": false, 

"host": "xxxx.compute.amazonaws.com", 
"user": "ubuntu", 
//"password": "password", 
"port": "22", 

"remote_path": "/home/ubuntu/", 
"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": 30, 
//"keepalive": 120, 
//"ftp_passive_mode": true, 
//"ftp_obey_passive_host": false, 
"ssh_key_file": "~/.ssh/id_rsa", 
"sftp_flags": ["-o IdentityFile=<YOUR.PEM FILE path>"], 

//"preserve_modification_times": false, 
//"remote_time_offset_in_hours": 0, 
//"remote_encoding": "utf-8", 
//"remote_locale": "C", 
//"allow_config_upload": false, 

}


如果您有权限问题:

chmod -R 0777 /home/ubuntu/YOURFILE/ 

这只是使读取和写入所有用户

您可能希望创建一个新用户,如果上面没有为你工作: https://habd.as/sftp-to-ubuntu-server-sublime-text/ 我不知道这是不同的,但看起来像它开始为我的用户一旦我创建一个新用户