2017-08-25 51 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/ 我不知道這是不同的,但看起來像它開始爲我的用戶一旦我創建一個新用戶