0

i have a linux hosting working with cakephp.some sites got intrusion/hacked.i used nmap to see the open ports.

i found 21/tcp open ftp is the port which should be restricted and not accessible via public.

also i am thinking to restrict /app/config from 777 to 755 and also change databse.php file 'login' => 'root', to user.

can i restrict ftp port 21 to set priviledge if yes, what effect it will have.

how to set priviledge on ftp port 21 of a host.

other ideas regarding security is also welcomed.

2
  • You only can set fw to allow connections from some ip.
    – 2707974
    Mar 18, 2014 at 7:06
  • yeah,how its done.any links for some more ideas
    – black
    Mar 18, 2014 at 7:08

1 Answer 1

0

Enable fw

sudo ufw enable

To allow packets from xxx.xxx.xxx.xxx

sudo ufw allow from xxx.xxx.xxx.xxx

To allow packets from network xxx.xxx.xxx.xxx/24

sudo ufw allow from xxx.xxx.xxx.xxx/24

allow IP address xxx.xxx.xxx.xxx access to port 21 for all protocols

sudo ufw allow from xxx.xxx.xxx.xxx to any port 21

allow IP address xxx.xxx.xxx.xxx access to port 21 using TCP

sudo ufw allow from xxx.xxx.xxx.xxx to any port 21 proto tcp
1
  • To see status command is: sudo ufw status
    – 2707974
    Mar 18, 2014 at 7:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .