Monday, August 10, 2020

Linux Cent OS Network Handy commands

 

Linux Cent OS Network Handy commands


tcp connection details:

sof -i

COMMAND   PID     USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME

ssh     15465 shgeorge    3r  IPv4 628118962      0t0  TCP 172.21.1.100:42329->sdc-f5-dmz-ltm-01-ve.aim.local:ssh (ESTABLISHED)

lsof -i :ssh

COMMAND   PID     USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME

ssh     15465 shgeorge    3r  IPv4 628118962      0t0  TCP 172.21.1.100:42329->sdc-f5-dmz-ltm-01-ve.aim.local:ssh (ESTABLISHED)


 netstat -an | grep LISTEN

tcp        0      0 192.168.100.1:53            0.0.0.0:*                   LISTEN      

tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      

tcp        0      0 0.0.0.0:58811               0.0.0.0:*                   LISTEN      

tcp        0      0 127.0.0.1:199               0.0.0.0:*                   LISTEN      

tcp        0      0 127.0.0.1:5900              0.0.0.0:*                   LISTEN      

tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      

tcp        0      0 :::22                       :::*                        LISTEN      

tcp        0      0 :::111                      :::*                        LISTEN      

tcp        0      0 :::58992                    :::*                        LISTEN      

unix  2      [ ACC ]     STREAM     LISTENING     17044  /var/lib/libvirt/qemu/sdc-securid-vm.deerfield.aim.local.monitor

unix  2      [ ACC ]     STREAM     LISTENING     221367479 /var/run/salt/minion/minion_event_942f3619a7_pull.ipc

unix  2      [ ACC ]     STREAM     LISTENING     14014  /var/run/rpcbind.sock


biggest top 10 directories

du -hs */ | sort -nr | head


biggest file

ls -lS | head


 ls -lS | head


Linux Firewall

eg. permit udp/69

iptables -D INPUT -p udp –dport 69 -j ACCEPT


# Allows connections to SSH/SFTP/SCP

-A INPUT -j ACCEPT -p tcp --dport 22

# Allow ping 

-A INPUT -p icmp -j ACCEPT


openssl

open key file 

openssl req -nodes -newkey rsa:2048 -keyout myserver.key -out server.csr



search a file *.xml


find . -name *.xml

  find files bigger than 10,000 bytes


find . -size +10000c -size -50000c -print

 

 Top 10 directories

biggest top 10 directories

du -hs */ | sort -nr | head


Server Performance Using vmstat Command

vmstat -a

ZIP  a file


gzip -ztf archive.tar.gz


unzip tar file

tar:

tar -tf archive.tar

No comments:

Post a Comment

Palo Alto firewall handy troubleshooting CLI commands

 > show interface management Show management Interface details > show system info Display system’s management IP, Serial number, and c...