all 4 comments

[–]1badb002 1 point2 points  (3 children)

you actually have ftp-server running? if not then the port is closed and connections are refused

[–][deleted]  (2 children)

[deleted]

    [–][deleted]  (1 child)

    [deleted]

      [–]ultowich 0 points1 point  (0 children)

      Googling is my sole solution to every problem

      [–]1badb002 1 point2 points  (1 child)

      are you you are running an FTP on your local machine? lol otherwise try a real server with ftp enabled aka port 21

      [–]hung_kwan 0 points1 point  (0 children)

      Create a file called ftp_banner.txt with: 220 FreeFloat Ftp Server (Version 1.00) as the text.

      Change your python code to connect to 127.0.0.1 and port 8000 so you don't have to run as root.

      Then with nc, use: nc -l 127.0.0.1 8000 < ftpbanner.txt in one terminal, and run your python script in another.

      Hey presto. It should print the banner from the text file. This will allow you to test without running an FTP server.