Write a Unix shell script to test all ports connections from one server(gateway
ID: 3729008 • Letter: W
Question
Write a Unix shell script to test all ports connections from one server(gateway or client) to multiple servers. Client server has password less connection to other host. Write that output into two files I.e successful(opened ports )connection ports list with hostname and refused connection ports numbers with hostnames.Thanks... Write a Unix shell script to test all ports connections from one server(gateway or client) to multiple servers. Client server has password less connection to other host. Write that output into two files I.e successful(opened ports )connection ports list with hostname and refused connection ports numbers with hostnames.
Thanks...
Thanks...
Thanks...
Explanation / Answer
while { [gets $ifil host] >=0 } { # set timeout 600 spawn telnet $host expect ":" send "myusername " expect ":" send "mypassword " expect ">" send "en " expect ":" send "mypassword2 " expect "#" sleep 3 send "telnet 10.11.19.14 49 " expect { {Connection to} { puts "$host tacacs ok" } {Connection timed out} { puts "$host tacacs nok" } }
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.