This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:sysadmin [2016/07/12 21:19] mstraub [Network Configuration] |
linux:sysadmin [2020/08/20 11:59] (current) mstraub [Check Open Ports & Connections] |
||
---|---|---|---|
Line 242: | Line 242: | ||
# │ │ │ │ | │ └ command | # │ │ │ │ | │ └ command | ||
# │ │ │ │ | └───── user executing the command | # │ │ │ │ | └───── user executing the command | ||
- | # │ │ │ │ └───────── day of week (0 - 7) (0 to 7 are Sunday to Sunday, or use names) | + | # │ │ │ │ └───────── day of week (0 - 7) (0 to 7 are Sunday to Sunday, or use names such as MON-FRI) |
- | # │ │ │ └───────────── month (1 - 12) | + | # │ │ │ └───────────── month (1 - 12) (or names such as JAN-DEC) |
# │ │ └───────────────── day of month (1 - 31) | # │ │ └───────────────── day of month (1 - 31) | ||
# │ └───────────────────── hour (0 - 23) | # │ └───────────────────── hour (0 - 23) | ||
Line 249: | Line 249: | ||
</code> | </code> | ||
+ | [[https://crontab.guru|nifty online editor]] | ||
==== More crontab ==== | ==== More crontab ==== | ||
Also possible, but not encouraged in order to not put cron jobs into too many different places and overcomplicate administration, are the following options: | Also possible, but not encouraged in order to not put cron jobs into too many different places and overcomplicate administration, are the following options: | ||
Line 676: | Line 677: | ||
<code bash> | <code bash> | ||
netstat -a # print open & listening internet connections and Unix domain sockets | netstat -a # print open & listening internet connections and Unix domain sockets | ||
- | netstat -a -t # print only tcp connections (-u for udp) | + | netstat -a -t -p # print only tcp connections (-u for udp) and the associated pid |
netstat -s # print statistics about e.g. nr of received packets | netstat -s # print statistics about e.g. nr of received packets | ||
netstat -r # print the kernel routing table | netstat -r # print the kernel routing table | ||
Line 685: | Line 686: | ||
nmap localhost # print open ports on current machine (only a selection of common ports) | nmap localhost # print open ports on current machine (only a selection of common ports) | ||
nmap -p 1-9999 host # print open ports on a host (with a defined port range) | nmap -p 1-9999 host # print open ports on a host (with a defined port range) | ||
+ | nmap -Pn -p 1-9999 host # as above, but skip host discovery (helpful if above probe fails) | ||
nmap -A -T4 host # print open ports with enabled version detection (-A) and don't wait too long (-T4) | nmap -A -T4 host # print open ports with enabled version detection (-A) and don't wait too long (-T4) | ||
</code> | </code> |