ssh免登錄 & sftp 直接修改保存線上機(jī)代碼

Ssh免登錄

1.本地ssh 生成鑰匙

2.復(fù)制id_rsa.pub中的內(nèi)容

3.登陸服務(wù)器~/.ssh/authorized_keys 中添加

然后本地直接sshroot@xx.xx.xx.xx

sftp

1.需要sublime有sftp 擴(kuò)展。

2.與線上代碼目錄一致

3.與線上代碼結(jié)構(gòu)一致

Example. ? 本地。/my/wf

線上/data1/www/htdocs/wf/

在本地

wf目錄右鍵sftp->Edit Remote Mapping ? ?生成相應(yīng)的配置文件

并修改

記得給權(quán)限

chmod -R 777

保存測(cè)試 看是否成功

下面是配置 ? ?

其中?

?"host": “47.93.xx.xx", ?主機(jī)地址

"user": "root", ?連接名稱 ? 有ssh可以不用密碼


{

// 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": false,

"sync_skip_deletes": false,

"sync_same_age": true,

"confirm_downloads": false,

"confirm_sync": true,

"confirm_overwrite_newer": false,

"host": “47.93.xx.xx",

"user": "root",

//"password": "password",

//"port": "22",

"remote_path": "/data1/www/htdocs/wf/",

"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": ["-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,

}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容