Just to execute the command
# bash main.sh 'netstat -nltp'
Commands to be executed on each host:
netstat -nltp
=============================================
##############################################
host:***.***.***.***
command:netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 0.0.0.0:10022 0.0.0.0:* LISTEN 1055/sshd
##############################################
host:***.***.***.***
command:netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 0.0.0.0:10022 0.0.0.0:* LISTEN 1127/sshd
##############################################
Setting file
- ./host.txt
- ~/.ssh/config
- /etc/ssh/ssh_config