Thursday, 17 September 2015

[Linux] Check Firewall on CentOS

Check firewall on CentOS

$ su -
Password:
# iptables -L
--OR--
# service iptables status
# service iptables stop
# service iptables start

Check firewall on CentOS 7

Disable Firewalld
To disable firewalld, run the following command as root:
# systemctl disable firewalld

Stop Firewalld
To stop firewalld, run the following command as root:
# systemctl stop firewalld

Check the Status of Firewalld
And finally, to check the status of firewalld, run the following command as root:
# systemctl status firewalld

[Linux] Kiểm tra phiên bản hệ điều hành Linux


Check version linux

uname -a
uname -rms
cat /etc/system-release
cat /proc/version
lsb_release -a

[Tools] WinSCP Windows Secure CoPy

WinSCP is an open source free SFTP client and FTP client for Windows. Its main function is the secure file transfer between local and remote computer.

[Linux] Check and open ports in CentOS / Fedora / Redhat


If you want to open or close a port for a Linux firewall you have to edit the rules in the iptables configuration. By default iptables firewall stores its configuration at /etc/sysconfig/iptables file. You need to edit this file and add rules to open port.

Here are the steps to open the port XY using the default visual editor vi:

Open port XY

Open flle /etc/sysconfig/iptables:

# vi /etc/sysconfig/iptables

Append rule as follows:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport XY -j ACCEPT



Save and close the file. Restart iptables:

# /etc/init.d/iptables restart

Verify that port is open

Run following command:

# netstat -tulpn | less
Make sure iptables is allowing port connections:

# iptables -L -n