-1

I have created a new EC2 instance and installed ftop on it. I am able to access it through PuTTY and WinSCP. Suddenly, once when I try to open through WinSCP, it is giving an error as:

  1. The server rejected SFTP connection, but it listens for FTP connections. Did you want to use FTP protocol instead of SFTP? Prefer using encryption.

And through PuTTY it is showing as "CONNECTION REFUSED". I even tried restarting the instance. What is the problem?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Nikitha
  • 11
  • 3
  • 1
    Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Web Applications Stack Exchange](http://webapps.stackexchange.com/), [Webmaster Stack Exchange](http://webmasters.stackexchange.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Jun 15 '17 at 16:15

3 Answers3

1

Make sure the FTP ports that you are trying to access on the machine are enabled by the inbound security group rules.

This answer should help you out further inbound security group.

Also double check to make sure your EC2 machine doesn't have a firewall that may be blocking connections that are allowed by your inbound security policy.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Pandelis
  • 1,854
  • 13
  • 20
  • i tried changes the security group but it is giving me the same error in putty an winscp please help me out with this – Nikitha Jun 15 '17 at 14:49
1

If you want to access your Linux EC2 server instance via PuTTY or WinSCP, and you find that you can no longer successfully establish a connection to it, you can do the following in your EC2 AWS Console:

  1. Go to the left panel of your EC2 AWS Console, Network & SecuritySecurity Groups → *<your security group name>

  2. In the Inbound tab, click "Edit".

  3. Go to column "Type", row "SSH".

  4. Go to column "Source" of row "SSH", click the "Custom" dropdown field.

  5. Select "My IP" → Doing this should automatically update your present public IP address setting in AWS.

Take note that your public IP address may change from time to time, depending on your ISP (Internet service provider).

Having said this, whenever it does change, you should be able to resolve this issue by redoing steps 1 - 5.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
masarapmabuhay
  • 466
  • 1
  • 9
  • 15
0

it might be SSH service interrupted. Try to change permissions in the home directory. If the .ssh/ folder permissions changed, you can not connect to the instance. You can try shutdown and then start instead of restart.

If it is not working, please create AMI image of that server, and then try to launch a new instance from that image. Definitely it will work.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131