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 ftphosts
file, touch /etc/ftphosts
and 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.5
In the example below, we allow the user ftpadmin
to connect via FTP
from the explicitly listed addresses 208.164.186.1
208.164.186.2
208.164.186.4,
and
deny the specified ftpadmin
user to connect from the site 208.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 ftpusers
file, touch /etc/ftpusers
and add in this file the following users for security reasons:
root bin daemon adm lp sync shutdown halt mail news uucp operator games nobody
Now, change its default permission to be 600
:
[root@deep ] /# chmod 600 /etc/ftpusers