Hi, this will be my first how-to on these forums, so bare with me! Any pointers or advice are very welcome.
First, let's start with proftpd. What, Why and How?
I have had no previous experience with setting up an ftp whatsoever in the past, but this week, I got bored with constantly accessing my external hard drive for every file I need to transfer between my computers. Therefore, i needed something easy and quick to install, without having to configure too much. If you need to know more about the history of proftpd, plz click the link above.
The next how-to is based on several (outdated) websites I read, together with my own experiences. I hope it'll help someone who wants to do the same thing.
If you don't have internet (like I did my first month on Fedora, damn wifi support :P), you can download proftpd manually from any repository (assuming you have another computer with internet off course): http://rpm.pbone.net/
If you do have internet (like a sensible person does), just use yum. First check if it isn't installed allready, if not then go ahead and install it.
yum info proftpd
sudo yum install proftpd
first of all, you can create a new account on your linux machine if needed. This will be the account which can be used by the ftp server.
> Menu > Administration > Users and Groups (enter root password)
> Add User
-------> User Name: ftp (or whatever you want)
-------> Password: ftp (or whatever you want)
-------> Create home directory: tick this off... we don't need it
-------> Login Shell: /sbin/nologin
Check whether the 'ftp' user is in the 'ftp' group!
Next up is the actual proftpd configuration. For this, we need to edit the file /etc/proftpd.conf. First start by making a backup file for when things go wrong. Afterwards, open the config file and start editing:
sudo cp /etc/proftpd.conf /etc/proftpd.conf_backup
sudo nano /etc/proftpd.conf (use whatever editor you like, i always use nano :P)
I copy-pasted a very basic configuration file below. Make sure that the 'User' and 'Group' settings are related to the account you made above.
#make sure this file is /etc/proftpd.conf
#and is owned by 'root' who has read+write rights
ServerIdent on "LOLLYSERVER ready."
Port 21 #standard FTP port
Umask 022 #prevent new dirs and files to be writable by everyone
MaxInstances 10 #maximum number of child processes
TimeoutStalled 100 #maximum number of seconds a data connection is allowed to stall
User nobody #user and group that the server runs at
Group ftp #group with little privileges
DefaultRoot ~ #put '~' here if you want non-anonymous users to be chrooted to their homedir
ListOptions "-a" #list 'invisible' directories and files
UserAlias anonymous ftp #be able to login as both 'ftp' and 'anonymous'
MaxClients 10 "Sorry, max %m users -- try again later"
DefaultChdir /pub #/var/ftp/pub
RequireValidShell off #don't give a valid shell to user ftp
AccessGrantMsg "User %u logged in."
After editing the configuration file to your liking, it is probably very wise to check it for errors. When performing this command, you should get "Syntax check complete." back in the console window. Check if it displays errors. If it does, you need to recheck your configuration file to find the errors.
Make sure that the '/etc/sysconfig/proftpd' file contains this line at the bottom (to enable anonymous login)
If everything went well, it is time to start the ftp server and check if everything works well.
sudo /etc/init.d/proftpd start
ps -ef | grep proftpd
The first command should return "Starting proftpd: [ OK ]". The second one should return something similar to:
[lollysticky@LOLLYSTICKY Documents]$ ps -ef | grep proftpd
proftpd 4328 1 0 19:19 ? 00:00:00 proftpd: (accepting connections)
500 4339 4269 0 19:21 pts/1 00:00:00 grep proftpd
Let's try to connect to the ftp:
you can connect using your normal linux username (in my case: lollysticky), or you can use 'ftp' or 'anonymous' to connect. With the accounts 'ftp' and 'anonymous', you only need to enter your email (or nothing) as a password.
If you logged in with the linux username, you'll be directed to your home directory. When you use 'ftp' or 'anonymous' to login, the linux system will 'chroot' you to /var/ftp/, which will be seen as the ftp 'root'.
I then tried to connect remotely to my ftp server with several programs (Transmit, FileZilla,...). This succeeded both from my own home network as from a remote area.
I hope this will helpe someone. If there is need for more pictures, just ask!