Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SFTP to EC2 Windows Instance

So i've setup a windows instance, but can't seem to FTP into it. After much research, i've discovered SFTP is the way forward.

I've setup my security group, adding the following rule: SSH tcp 22 22 0.0.0.0/0

Using the public DNS name supplied in the console, i try to SFTP in using Filezilla & Cyberduck, but they just time out.

I know the next step is sorting out the key pairs, but i doubt that'll do me any good if my server isn't even accepting connections.

Any idea what i've missed?

EDIT: Looking at the Filezilla logs, its looks like the server isn't responding to the connection requests...

12:51:29    Status: Connecting to ec2-122-248-248-178.ap-southeast-1.compute.amazonaws.com...
12:51:29    Response:   fzSftp started
12:51:29    Command:    keyfile "D:\Users\berling\Lacie Fuj Sync\Freelancing\AWS_Public_Key.ppk"
12:51:29    Command:    open "[email protected]" 22
12:51:49    Error:  Connection timed out
12:51:49    Error:  Could not connect to server

Do i need to install an SFTP/SSH server on the server? I was under the impression it was already setup for Amazon servers for some reason... am i wrong about that?

like image 270
Jeeby Avatar asked Feb 22 '11 00:02

Jeeby


People also ask

How do I transfer files from Windows to EC2 instance?

Open a new command prompt and run the following command replacing the fields as needed: scp -P 2222 Source-File-Path user-fqdn @localhost: To copy the entire directory instead of a file, use scp -r before the path. This recursively copies all of the directory's contents to the destination EC2 instance.

Can you SFTP to a Windows server?

You can use the built-in OpenSSH package in Windows to easily enable secure file transfers between the client and Windows server using the SFTP (Secure FTP) protocol. In this article, we will show how to install and configure an SFTP server on Windows 10 or Windows Server 2022/2019/2016/2012R2.


1 Answers

The rule you have set up - SSH tcp 22 22 0.0.0.0/0 - where is that? Your firewall, or at the EC2 end? And why 0.0.0.0? I would recommend using real IP addresses.

Check why the connection is timing out - is SFTP getting past your firewall? Is it getting blocked at the EC2 end - firewall or network logs will be your friend here.

Have you confirmed it is timing out before starting the handshake? Check SSH logs.

Do you have an SFTP server running and configured correctly? Some require all configs to be set before they are happy - your comment that you haven't yet sorted key pairs makes me wonder if this one only accepts certificate auth.

Check those and see how you do.

like image 110
Rory Alsop Avatar answered Sep 28 '22 07:09

Rory Alsop