热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

sftp传输文件安全吗_如何使用SFTP将文件安全地传输给其他人

sftp传输文件安全吗We’vepreviouslywrittenabouthostingyourownFTPserver,butdataistransferredincleart
sftp传输文件安全吗

sftp传输文件安全吗

We’ve previously written about hosting your own FTP server, but data is transferred in cleartext, making it unsuitable for confidential file transfers.  In this guide we’ll go over the secure version of FTP – SFTP, and why it makes for an excellent way of transferring files to other people across the internet.

我们之前已经写过有关托管自己的FTP服务器的文章 ,但是数据以明文形式传输,因此不适合用于机密文件传输。 在本指南中,我们将介绍FTP的安全版本– SFTP,以及为什么它是通过Internet将文件传输给其他人的绝佳方法。

为什么要使用SFTP? (Why SFTP?)

Geeks run into this problem all the time: You have a file that’s just too big to transfer over email or instant messenger.  Sure, you could upload it to Dropbox or some other cloud service, but what if you don’t have/want an account with them, have enough storage freed up,  or what if you just want to bypass the middle man altogether? Not to mention the security concerns with cloud services.

极客经常遇到这个问题:您的文件太大,无法通过电子邮件或即时通讯程序进行传输。 当然,您可以将其上传到Dropbox或其他一些云服务,但是如果您没有/想要使用它们的帐户,没有足够的存储空间,或者如果您只想完全绕过中间人怎么办? 更不用说云服务的安全问题。

Instead of going through that hassle, you can save time by transferring files (big and small) to your friend by using SFTP.  There’s no need to encrypt your files before transfer, because they are being tunneled through the very secure SSH protocol.  Not only that, but now you can upload directly to your friend instead of the cloud, saving lots of time.

您可以通过使用SFTP将文件(大小)传输给您的朋友来节省时间,而不用麻烦。 传输之前无需加密文件,因为它们通过非常安全的SSH协议进行传输。 不仅如此,现在您还可以直接上传到您的朋友而不是云上,从而节省了大量时间。

But wait, there’s more!  If you want to share out more files with people, you can just drop them in a specified folder and your buddies can browse that section of your PC as if it were a part of their own.  Sharing files can be a whole lot easier with this method, because the uploading will be initiated by your friend instead of you.  All you have to do is drag and drop, and let them know they can now download the file(s).

但是,等等,还有更多! 如果您想与其他人共享更多文件,只需将它们放在指定的文件夹中,您的伙伴就可以浏览PC的该部分,就好像它属于他们自己的一部分一样。 使用此方法可以更轻松地共享文件,因为上传将由您的朋友而不是您发起。 您所要做的就是拖放,并让他们知道他们现在可以下载文件。

设置SFTP (Setting up SFTP)

Setting up an SFTP server in Windows is going to require some third party software.  Most software that has this functionality is going to cost you, but we will be using a free one called freeFTPd.  Click that link to download and install the program.  Be forewarned, the developers clearly aren’t native English speakers, and it shows in a lot of the text.  Don’t be alarmed though, it’s a legitimate program that we’ve tested and everything checks out – you’ll be hard-pressed to find a better free alternative.

在Windows中设置SFTP服务器将需要某些第三方软件。 大多数具有此功能的软件都将向您收费,但我们将使用一个名为freeFTPd的免费软件。 单击该链接下载并安装程序。 请注意,开发人员显然不是母语为英语的人,并且在很多文字中都显示了这一点。 不过请不要惊慌,它是我们已经测试过的合法程序,所有内容都可以检出-很难找到更好的免费替代品。

Go through installation as normal, and at the end there will two prompts, one asking if private keys should be created, and the other asking if it should run as a service; click Yes on both.

正常进行安装,最后会有两个提示,一个询问是否应创建私钥,另一个询问是否应作为服务运行; 两者都单击“是”。

When installation finishes, open freeFTPd via the new shortcut icon on your desktop.  We ran into problems writing configuration changes, so make sure you right click on the icon and run the program as Administrator.

安装完成后,通过桌面上的新快捷方式图标打开freeFTPd。 我们在编写配置更改时遇到了问题,因此请确保您右键单击该图标并以管理员身份运行该程序。

To get started with the configuration, click on Users to the left.

要开始配置,请单击左侧的“用户”。

In this menu, click on Add and fill out the information for a new user account to access your server.

在此菜单中,单击添加,然后为新用户帐户填写信息以访问您的服务器。

Under Authorization, you can choose to use “NT authentication” or “Password stored as SHA1 hash.”  NT authentication means that it uses a Windows username and password, so you’d need to create a new user on your computer for anyone who accesses the SFTP directory.  In most cases, it will probably be best to just store the password as a SHA1 hash and keep the SFTP user separate from the Windows users.

在授权下,您可以选择使用“ NT身份验证”或“存储为SHA1哈希的密码”。 NT身份验证意味着它使用Windows用户名和密码,因此您需要在计算机上为访问SFTP目录的任何人创建一个新用户。 在大多数情况下,最好仅将密码存储为SHA1哈希,并使SFTP用户与Windows用户分开。

After you’ve typed in the desired username and password, uncheck the “FTP server” box towards the bottom and then click Apply.  Now that the user is setup, click on the SFTP tab.

输入所需的用户名和密码后,取消选中底部的“ FTP服务器”框,然后单击“应用”。 现在已经设置了用户,单击SFTP选项卡。

The only thing really worth changing on this tab is the SFTP root directory.  This specifies where the files you want to share out will reside.  For simplicity, we’re just going to change the already populated directory to a folder on the desktop.

在此选项卡上唯一真正值得更改的是SFTP根目录。 这指定了要共享的文件将驻留的位置。 为了简单起见,我们将要将已经填充的目录更改为桌面上的文件夹。

Once you’re ready to begin hosting files, click the Start button in this tab.  Windows Firewall will probably pop up and ask you if this is OK – click Allow access.

准备开始托管文件后,请单击此选项卡中的开始按钮。 Windows防火墙可能会弹出并询问您是否可以–单击“允许访问”。

Now you should be able to return to the Status tab and see that your SFTP server is running.

现在,您应该能够返回到“状态”选项卡,并看到您的SFTP服务器正在运行。

Click on Apply & Save to keep these changes and then close the window.

单击“应用并保存”以保留这些更改,然后关闭窗口。

freeFTPd will continue to run in the background.  To access it, just open it up from the notification area.

freeFTPd将继续在后台运行。 要访问它,只需从通知区域将其打开。

访问SFTP目录 (Accessing the SFTP Directory)

Put a couple of files in your SFTP directory so we can do some testing.  If you left the home directory for the user at its default ($SERVERROOT\geek in our example), then you’ll need to create another directory within the SFTP root directory.

将几个文件放在您的SFTP目录中,以便我们进行一些测试。 如果您将用户的主目录保留为默认目录(在我们的示例中为$ SERVERROOT \ geek),则需要在SFTP根目录中创建另一个目录。

As you can see in this screenshot, we put two test files into the ‘geek’ directory which is inside of the ‘SFTP server files’ (SFTP root directory) folder.  Make sure that port 22 is forwarded to your PC on your router, and then you’re ready for someone to connect to your PC.  See this guide if you need help with port forwarding.

如您在此屏幕快照中所见,我们将两个测试文件放入“ SFTP服务器文件”(SFTP根目录)文件夹内的“ geek”目录中。 确保将端口22转发到路由器上的PC,然后准备好有人连接到PC。 如果您需要端口转发方面的帮助,请参阅本指南 。

Have your buddy download an FTP client that is able to access SFTP servers – our recommendation is FileZilla. They will just need to type in your IP address, the username and password that you configured earlier, and specify the port your server is running on (if you left it at the default, it will be port 22).

让您的伙伴下载一个能够访问SFTP服务器的FTP客户端-我们的建议是FileZilla 。 他们只需要输入您的IP地址,先前配置的用户名和密码,并指定服务器运行的端口即可(如果将其保留为默认端口,则为端口22)。

The first time they connect to your server, they will be prompted to save the host keys.  They just need to check the “Always trust” box and click OK to never be prompted about this again (unless you change your host keys for some reason).

他们第一次连接到服务器时,将提示他们保存主机密钥。 他们只需要选中“始终信任”框,然后单击“确定”就不会再出现此提示(除非您出于某种原因更改了主机密钥)。

Your friend should now be able to access the files you placed within the SFTP directory, and add files to it that they would like to share with you.

您的朋友现在应该可以访问您放置在SFTP目录中的文件,并向其中添加文件,以便与您共享。

翻译自: https://www.howtogeek.com/177105/how-to-securely-transfer-files-to-someone-else-with-sftp/

sftp传输文件安全吗



推荐阅读
  • 利用Visual Basic开发SAP接口程序初探的方法与原理
    本文介绍了利用Visual Basic开发SAP接口程序的方法与原理,以及SAP R/3系统的特点和二次开发平台ABAP的使用。通过程序接口自动读取SAP R/3的数据表或视图,在外部进行处理和利用水晶报表等工具生成符合中国人习惯的报表样式。具体介绍了RFC调用的原理和模型,并强调本文主要不讨论SAP R/3函数的开发,而是针对使用SAP的公司的非ABAP开发人员提供了初步的接口程序开发指导。 ... [详细]
  • 如何使用Java获取服务器硬件信息和磁盘负载率
    本文介绍了使用Java编程语言获取服务器硬件信息和磁盘负载率的方法。首先在远程服务器上搭建一个支持服务端语言的HTTP服务,并获取服务器的磁盘信息,并将结果输出。然后在本地使用JS编写一个AJAX脚本,远程请求服务端的程序,得到结果并展示给用户。其中还介绍了如何提取硬盘序列号的方法。 ... [详细]
  • [译]技术公司十年经验的职场生涯回顾
    本文是一位在技术公司工作十年的职场人士对自己职业生涯的总结回顾。她的职业规划与众不同,令人深思又有趣。其中涉及到的内容有机器学习、创新创业以及引用了女性主义者在TED演讲中的部分讲义。文章表达了对职业生涯的愿望和希望,认为人类有能力不断改善自己。 ... [详细]
  • 解决Cydia数据库错误:could not open file /var/lib/dpkg/status 的方法
    本文介绍了解决iOS系统中Cydia数据库错误的方法。通过使用苹果电脑上的Impactor工具和NewTerm软件,以及ifunbox工具和终端命令,可以解决该问题。具体步骤包括下载所需工具、连接手机到电脑、安装NewTerm、下载ifunbox并注册Dropbox账号、下载并解压lib.zip文件、将lib文件夹拖入Books文件夹中,并将lib文件夹拷贝到/var/目录下。以上方法适用于已经越狱且出现Cydia数据库错误的iPhone手机。 ... [详细]
  • 本文介绍了RPC框架Thrift的安装环境变量配置与第一个实例,讲解了RPC的概念以及如何解决跨语言、c++客户端、web服务端、远程调用等需求。Thrift开发方便上手快,性能和稳定性也不错,适合初学者学习和使用。 ... [详细]
  • 如何在服务器主机上实现文件共享的方法和工具
    本文介绍了在服务器主机上实现文件共享的方法和工具,包括Linux主机和Windows主机的文件传输方式,Web运维和FTP/SFTP客户端运维两种方式,以及使用WinSCP工具将文件上传至Linux云服务器的操作方法。此外,还介绍了在迁移过程中需要安装迁移Agent并输入目的端服务器所在华为云的AK/SK,以及主机迁移服务会收集的源端服务器信息。 ... [详细]
  • 本文介绍了在使用Python中的aiohttp模块模拟服务器时出现的连接失败问题,并提供了相应的解决方法。文章中详细说明了出错的代码以及相关的软件版本和环境信息,同时也提到了相关的警告信息和函数的替代方案。通过阅读本文,读者可以了解到如何解决Python连接服务器失败的问题,并对aiohttp模块有更深入的了解。 ... [详细]
  • Python瓦片图下载、合并、绘图、标记的代码示例
    本文提供了Python瓦片图下载、合并、绘图、标记的代码示例,包括下载代码、多线程下载、图像处理等功能。通过参考geoserver,使用PIL、cv2、numpy、gdal、osr等库实现了瓦片图的下载、合并、绘图和标记功能。代码示例详细介绍了各个功能的实现方法,供读者参考使用。 ... [详细]
  • 本文介绍了在mac环境下使用nginx配置nodejs代理服务器的步骤,包括安装nginx、创建目录和文件、配置代理的域名和日志记录等。 ... [详细]
  • WebSocket与Socket.io的理解
    WebSocketprotocol是HTML5一种新的协议。它的最大特点就是,服务器可以主动向客户端推送信息,客户端也可以主动向服务器发送信息,是真正的双向平等对话,属于服务器推送 ... [详细]
  • 本文介绍了Windows操作系统的版本及其特点,包括Windows 7系统的6个版本:Starter、Home Basic、Home Premium、Professional、Enterprise、Ultimate。Windows操作系统是微软公司研发的一套操作系统,具有人机操作性优异、支持的应用软件较多、对硬件支持良好等优点。Windows 7 Starter是功能最少的版本,缺乏Aero特效功能,没有64位支持,最初设计不能同时运行三个以上应用程序。 ... [详细]
  • mac php错误日志配置方法及错误级别修改
    本文介绍了在mac环境下配置php错误日志的方法,包括修改php.ini文件和httpd.conf文件的操作步骤。同时还介绍了如何修改错误级别,以及相应的错误级别参考链接。 ... [详细]
  • iOS超签签名服务器搭建及其优劣势
    本文介绍了搭建iOS超签签名服务器的原因和优势,包括不掉签、用户可以直接安装不需要信任、体验好等。同时也提到了超签的劣势,即一个证书只能安装100个,成本较高。文章还详细介绍了超签的实现原理,包括用户请求服务器安装mobileconfig文件、服务器调用苹果接口添加udid等步骤。最后,还提到了生成mobileconfig文件和导出AppleWorldwideDeveloperRelationsCertificationAuthority证书的方法。 ... [详细]
  • 本文讨论了如何使用Web.Config进行自定义配置节的配置转换。作者提到,他将msbuild设置为详细模式,但转换却忽略了带有替换转换的自定义部分的存在。 ... [详细]
  • java drools5_Java Drools5.1 规则流基础【示例】(中)
    五、规则文件及规则流EduInfoRule.drl:packagemyrules;importsample.Employ;ruleBachelorruleflow-group ... [详细]
author-avatar
ayipyipyip
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有