The /etc/ftphosts file is used to define whether users are allowed to log in from certain hosts or whether there are denied access.
Create the
ftphostsfile, touch/etc/ftphostsand add for example in this file the following lines:# Example host access file # # Everything after a '#' is treated as comment, # empty lines are ignored allow ftpadmin 208.164.186.1 208.164.186.2 208.164.186.4 deny ftpadmin 208.164.186.5In the example below, we allow the user
ftpadminto connect viaFTPfrom the explicitly listed addresses208.164.186.1208.164.186.2208.164.186.4,and deny the specifiedftpadminuser to connect from the site208.164.186.5.Now, change its default permission to be
600:[root@deep ] /# chmod 600 /etc/ftphosts
The /etc/ftpusers/ file specifies those users that are NOT allowed to connect to your FTP server.
Create the
ftpusersfile, touch/etc/ftpusersand add in this file the following users for security reasons:root bin daemon adm lp sync shutdown halt mail news uucp operator games nobodyNow, change its default permission to be
600:[root@deep ] /# chmod 600 /etc/ftpusers