How to make PROFTPD files accessiable through internet
I am new in Linux/ubuntu.
I created a Proftpd server and configured it all. When I tried to access in local(ftp://127.0.0.1) with username and password, I am able to see and download files. I want to do this when I am remote. How can I do that? Should I download Filezilla or something else? Please guide me. Thanks in advance
1 Answer
This is actually a networking question, not a Linux one. To answer it, more information about your network setup would be needed, but I assume that it's a standard "home network" setup, ie. you have a NAT router that is connected to your Internet provider and your Ubuntu machine is on a local network behind that router.
You need to know your public IP address. This is the address that your router presents to the Internet. It is assigned to your router by your Internet provider. You can find it somewhere (where exactly - it depends on your router) when you access the router's administration panel, or you can find it by going to one of available online services that display your public IP address. I will, of course, recommend my own one :) Your public IP adddress will be displayed in the middle on top of the screen (mine is 89.64.227.137 for example). Note that it can change over time.
You need to know your Ubuntu machine private IP address. This is the address that is assigned by your router, internally within your home network, to the device that is connected to the router. You can obtain it by typing the command
ip address showor by going to Settings -> Network and clicking the gear icon next to the network connection that you use (either wired or wireless). For example mine is 192.168.15.100. This can also change over time, especially when you reboot your router. Usually there are some methods to configure your router to "fix" this address so that a particular hardware device (with the same MAC address) will always get the same IP address. This also depends on your router, so your router's manual is your best help here.You need to configure port forwarding on your router (again, router's manual is your best help). Your router may have a predefined setting to forward the FTP application, then it's best to use it (why - I will tell that later). Otherwise forward port number 21. Set it to forward to your internal IP address.
After you have configured port forwarding, you should be ready to test FTP service from the Internet. Use a FTP client (Filezilla is one of them, but you can also just use a browser as you used in your test) to connect from outside to your public IP address. You should be able to login and see the files.
If you are able to login, but you can't see the files, probably your router doesn't handle the FTP protocol very well. FTP protocol is special, because unlike most other protocols, it makes two connections simultaneously. The NAT routers should know about it and handle this specially. This is why I recommended to use the predefined entry for FTP application when forwarding a port, if one is available in your router. If your router has trouble with FTP protocol, you should check the configuration of your FTP client and see if there is an option to turn on so called passive mode. The passive mode is a workaround that allows to operate over routers that don't handle FTP protocol properly.