windows 从 AWS 上的 EC2 实例到远程机器的共享文件夹 (SMB)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20435470/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 11:09:15  来源:igfitidea点击:

Share Folder (SMB) from EC2 Instance on AWS to remote machine

windowsamazon-web-servicesamazon-ec2sambafileshare

提问by user2548469

I am trying to migrate an application to Amazon and need client machines to be able to connect in. Realistically it seems as though I'll just need to be able to MAP a folder on the EC2 instance (running Windows Server 2008 R2) to the client machines (running Windows 7) and that will be sufficient.

我正在尝试将应用程序迁移到 Amazon 并需要客户端机器才能连接。实际上,似乎我只需要能够将 EC2 实例(运行 Windows Server 2008 R2)上的文件夹映射到客户端机器(运行 Windows 7),这就足够了。

I've done quite a bit of searching online and came across this entry early on:

我在网上做了很多搜索,很早就发现了这个条目:

https://serverfault.com/questions/228468/unable-to-share-data-between-amazon-ec2-instances-for-windows#comment220635_231318

https://serverfault.com/questions/228468/unable-to-share-data-between-amazon-ec2-instances-for-windows#comment220635_231318

I have opened the ports on both ends of my test machine and the EC2 server and cannot make a successful connection. The folder is shared, I've checked and rechecked the permissions, the ports, etc, but to no avail. Can anyone help point me in the right direction?

我的测试机和EC2服务器两端的端口都打开了,连接不上。该文件夹是共享的,我已经检查并重新检查了权限、端口等,但无济于事。任何人都可以帮助我指出正确的方向吗?

Edit: I've also tried to VPN into the instance, again, to no avail.

编辑:我也试过 VPN 进入实例,再次,无济于事。

回答by Barak

Amazon is not blocking windows shares. As long as you have port 445 open on your security group, you should be able to connect to the windows instance.

亚马逊并没有阻止 Windows 共享。只要您在安全组上打开了端口 445,您就应该能够连接到 Windows 实例。

Make sure you do not have a client side firewall (either on your local machine or on your local network - it is not unusual for outgoing port 445 to be blocked on corporate networks).

确保您没有客户端防火墙(在您的本地计算机或本地网络上 - 出站端口 445 在公司网络上被阻止的情况并不少见)。

Bear in mind that sharing folders like this is not secure - files are not encrypted over the wire, so someone could see your data.

请记住,像这样共享文件夹并不安全 - 文件未通过网络加密,因此有人可以看到您的数据。

回答by Rico

I think AWS might be blocking Windows share from the outside world. Did you try setting up two instance in AWS just like the post you mentioned? If you are able to share folders successfully between two AWS instances then it may be the case that AWS is blocking access.

我认为 AWS 可能会阻止来自外部世界的 Windows 共享。您是否像您提到的帖子那样尝试在 AWS 中设置两个实例?如果您能够在两个 AWS 实例之间成功共享文件夹,则可能是 AWS 阻止了访问。

Another options is to create an AWS instance in a VPC group and then require your clients to connect to the VPC (but that may not fly for your specific application)

另一种选择是在 VPC 组中创建一个 AWS 实例,然后要求您的客户端连接到 VPC(但这可能不适用于您的特定应用程序)

In the case AWS is blocking access I would open a support ticket with them so they can explain you what's going on.

如果 AWS 阻止访问,我会与他们一起开一个支持票,以便他们可以向您解释发生了什么。

Alternatively you can try setting up your shared folder in S3 and use their IAM service to control access.

或者,您可以尝试在 S3 中设置您的共享文件夹并使用他们的 IAM 服务来控制访问。

Hope this helps.

希望这可以帮助。