3

So I have set up port forwarding on my router and have a public IP address for my raspberry pi. I can see the default webpage and it works great.

Now I want to actually create a FTP so that I can change the files on my web server. I have tried various tutorials but they all seem to be for local work. And I seem to lock myself out of the folders I need.

Any help would be great. I just want to change the index file in the /var/www directory while logged into my FTP with my public IP address from my Pi.

0cean_
  • 45
  • 3

2 Answers2

3

If you've enabled SSH (easily done with raspi-config), then you ought to be able to use SFTP.

$ sftp pi@192.168.0.2
Connected to 192.168.0.2.
sftp> pwd
Remote working directory: /home/pi

If you're having permissions problems on /var/www you'll need to make sure the pi user can read-write.

$ sudo chown -R pi:pi /var/www
$ ls -la /var/www
total 40
drwxr-sr-x  6 pi   pi   4096 Oct  8 19:19 .
drwxr-xr-x 12 root root 4096 Sep 22 09:59 ..
-rw-r--r--  1 pi   pi   2928 Oct  8 19:19 index.html
nachito
  • 131
  • 4
2

If you want to use FTP cross network, then you need to forward port 20. If you want to use SFTP cross network then forward port 22. SFTP is extremely simple if you already use SSH. If you need FTP, and not SFTP, follow this tutorial here: https://www.youtube.com/watch?t=1&v=r0BoBkv3cwg

Patrick Cook
  • 6,365
  • 8
  • 38
  • 63