云服务器文件传输问题
最近再做一個(gè)web項(xiàng)目,目前決定先把應(yīng)用放在云服務(wù)器上。我選擇的云主機(jī)是aliyun的Ubuntu 16.04主機(jī)。部署好云主機(jī)環(huán)境后,就需要把我在本地開發(fā)好的程序上傳到云主機(jī)了。剛開始打算用ftp協(xié)議來傳輸,于是參照網(wǎng)上的教程(Ubuntu 16.04下vsftpd 安裝配置實(shí)例_服務(wù)器應(yīng)用_Linux公社-Linux系統(tǒng)門戶網(wǎng)站),安裝vsftpd,設(shè)置相關(guān)參數(shù),本地安裝FileZilla。當(dāng)一切都設(shè)好后,到最后一步卻卡住了,使用ftp協(xié)議FileZilla怎么都連不上云主機(jī)。在網(wǎng)上搜了很多方法都無效,大部分認(rèn)為問題出在云主機(jī)的防火墻,但我檢查了我的云主機(jī)防火墻iptables服務(wù)根本沒開啟,最后還是沒有找到原因。
最后在Google上,搜解決辦法的時(shí)候,無意中看到有人說‘不要用ftp,ftp不安全的,早就該廢棄之類話’,而且提議用SFTP-SSH File Transfer Protocol來傳輸,而且FileZilla就支持該協(xié)議。二話不說,直接開試。點(diǎn)擊如上圖左上角的圖標(biāo),進(jìn)入Site Manager界面,選擇SFTP協(xié)議,登錄方式選擇秘鑰登錄,秘鑰用的就是云主機(jī)的連接秘鑰。
點(diǎn)擊connect,大喜,果然急速連接成功。如下圖,左邊是本地目錄,右邊是云主機(jī)目錄,連接成功后才會(huì)顯示。上傳文件操作極易,只需把左邊的文件直接拖到右邊即可。
在terminal上查看云主機(jī)上的文件,剛剛拖進(jìn)去的圖片已經(jīng)在云主機(jī)的硬盤里了。
參考網(wǎng)站(可能需要FQ):
https://askubuntu.com/questions/315378/ubuntu-web-server-ftp-connection-timeout 第二個(gè)回答
https://ubuntuforums.org/showthread.php?t=2234950 第五個(gè)回答
以下是一位外國(guó)網(wǎng)友的留言,貼在下方可以參考一下:
I’m more concerned about anyone using FTP. That protocol should have died 15 yrs ago for a number of reasons. It is like telnet. You have ssh running already, so just use an sftp client. There are lots of nice clients for every platform, it will be secure since passwords aren’t transmitted as plain text. If you use Windows - WinSCP is a nice client. There are others. The commands map 1-for-1 to old-school FTP (by design), so there isn’t anything new to learn. Plus the 3 main FTP servers have each had back doors inserted in their source code over the years - I think it happened to 1 of them twice. Just for clarification, nobody has announced any back doors in the current FTP servers that I know. Also - about the only organizations that should still be using FTP are those that want so share all files on the system with the entire world and don’t care who grabs the files. FTP doesn’t usually play nice with firewalls either.
On my home network when NFS isn’t available between the systems, I usually use scp or rsync with ssh-key-based authentication. It is very convenient - much more than FTP or sftp. OTOH, I’ve been called “odd”, so I can completely understand folks using sftp between their Windows and unix-like systems. If you need lots of easy access from Windows, then CIFS (samba) which has next to ZERO security is what most organization use. Just to be fair, NFS can be configured with low security and no encryption too. Neither NFS nor CIFS should be used over the internet (at least without a good VPN).
If you just want to share files with the entire world, use http. If authenticated logins are needed, then scp/sftp are what you want. FTP should have been killed off years ago.
總結(jié)
以上是生活随笔為你收集整理的云服务器文件传输问题的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 快捷键_AutoCAD 2021中的默认
- 下一篇: 信用卡积分换咖啡 一次需要一万多积分真的