5/30/2023 0 Comments Set up ftp serverThis will make sure users aren't doing things we don't want them to do. We are denying all ftp commands, so were we to not add allow statements later on, a user could do nothing. What we are doing here is giving ourselves a clean slate to work with. You can add as many of these AllowUser lines as necessary. This will limit all logins except for ftpuser (some user on your system). We will deny users the ability to change permissions on the ftp. It is not necessary, but I definately recommend keeping logs for troubleshooting and monitoring of traffic. The next three lines all have to do with logging. There's the scoreboard file we created earlier. ScoreboardFile /var/run/proftpd.scoreboard Those lines will not allow overwriting of files, and will allow users to resume downloads. Naturally, you'll want to have a static ip address setup. In my case, I need to then forward ports 50000-52000 to my computer. Because many hosts block port 21, you'll probably want to choose another one, in the high port range. Then you must choose a port range on which you will run the ftp server. First, replace username with your no-ip username. This is configuration for outside access to the server. This is straight out of the default config, so don't worry about it. I don't want users to be browsing any other files on my computer. What it will do is make /home/ftp the root of the server, so users won't be able to cd to /. Default root will set the root of the ftp. You will definately want standalone for the second line otherwise you'll have to mess around with inetd. The first line of course is the server's name. I will go over what each of these pieces mean. If you'd like to save yourself some typing, you may download my configuration here. Now it's time to configure the server itself. fat/media /home/ftp/pub/media nullfs rw 0 0 You probably don't want to give write permissions to this directory though! Of course you will want to set up a corresponding entry in fstab to do this all of the time. Now an ftp user would be able to download files from /fat/media (/fat is the mounted partition). Mount_nullfs /fat/media /home/ftp/pub/media For instance you may have a lot of files saved in an area you don't want to move to ftp's home, but want accessible on the server. It's possible that's not all you want for your directory structure. The chown and chmod on in will ensure that users cannot overwrite eachother's files. Make sure that only root can write to pub so people can't overwrite your files in there. home/ftp is the root of our FTP server, in is for incoming files, and pub is for files you want to be downloadable. Now it's time for us to set up the directory structure for Mr. With that done we will set up our ftp group. Now we need to set create proftpd.scoreboard otherwise proftpd won't start. Don't worry though, there's plenty of configuration to come. If you have a dynamic ip address it will be extremely useful to enable the no-ip service to allow access to wan clients.Īssuming that you've finished that we can setup the server. The default ftpd that comes with FreeBSD isn't bad, but proftpd has many more features, so its my FTP server of choice right now. Setting up an FTP Server Setting up an FTP ServerĪn FTP server can be a very useful way to transfer files too big for e-mail or instant messaging.
0 Comments
Leave a Reply. |