What is the method to block a machine from establishing connection to an outside ftp server. Both ftp and sftp.inet, iptables, shutdown service?
How to stop outbound ftp from being established. centos/ rhel
rhel;firewall;ftp
I'm guessing, but it looks like you want to block connections to port 21 and port 22 .  This can be done on the host itself for ftpiptables -I OUTPUT -p tcp --dport 21 \-d the.rem.ote.ip \-m comment --comment blocked as per ticket## \-j REJECTSFTP, though, is tricky:  it shares a port with ssh.  If you are okay with blocking the outgoing ssh connections too, then ^21^22 after that last command.  If you need to keep ssh and block sftp, you'd need to condition the remote end to never offer any sftp subcomment; or change your local config (not sure how) to prevent sftp of any kind (the challenge being users can download sftp binaries at any time).  Blocking port 21 and 22 on an intervening firewall you control is much more reliable, but that's not going to be a centos/rhel issue that you'd need to ask here.I think if you can't block all port-22 access via firewalls, then you're in for a rough time.