2

I used pip3 install pyftpdlib and it seemed to install correctly.
When I run python3 -m pyftpdlib -p 21 the output looks like:

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/kali/.local/lib/python3.7/site-packages/pyftpdlib/__main__.py", line 122, in <module>
    main()
  File "/home/kali/.local/lib/python3.7/site-packages/pyftpdlib/__main__.py", line 112, in main
    ftpd = FTPServer((options.interface, options.port), FTPHandler)
  File "/home/kali/.local/lib/python3.7/site-packages/pyftpdlib/servers.py", line 118, in __init__
    self.bind_af_unspecified(address_or_socket)
  File "/home/kali/.local/lib/python3.7/site-packages/pyftpdlib/ioloop.py", line 1018, in bind_af_unspecified
    raise socket.error(err)
OSError: [Errno 13] Permission denied

I added none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0 to the fstab file, but it did nothing.

Also, I may have installed it to the wrong place. Does this look right to you:

kali@kali:~/.cache/pip/wheels/69/f8/37/059165ed5bf71d7d824ac4f792009823361e159a47f4469420$ ls

pyftpdlib-1.5.6-py3-none-any.whl

I tried running in root and got this:

root@kali:~# python3 -m pyftpdlib -p 21
/usr/bin/python3: No module named pyftpdlib
  • Tried running it as administrator? Looks like you're trying to start a FTP server. Which is by default on a low port number. And low port numbers require admin privileges. – Torxed May 11 '20 at 22:09
  • @Torxed I just tried and got: `root@kali:~# python3 -m pyftpdlib -p 21 /usr/bin/python3: No module named pyftpdlib` – Lucas Shuck May 11 '20 at 22:13
  • you should probably install the library as root as well, seams like it ended up in your user dir or a virtualenv. – Torxed May 11 '20 at 22:21
  • Np bud, glad it worked. Added an answer for it so we can mark this as solved so we don't pile up the archive of unanswered stuff. – Torxed May 11 '20 at 22:41

1 Answers1

4

Usually these errors gets resolved by running the command as administrator.
You should be extremely careful with running non-verified software as admin tho, as it may compromise your computer.

But never the less, it looks like you're attempting to run a FTP server. Here's a writeup about why only root can listen to ports below 1024. This link might get rekt, but until then, that's a decent source of information.

Later in the comments we found out that the library you're using got installed as user, so installing that via pip as administrator also helps :)

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Torxed
  • 22,866
  • 14
  • 82
  • 131