Script to locating Linux servers


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to locating Linux servers
# 1  
Old 05-21-2013
Script to locating Linux servers

All,
Need an urgent help! ,
I have an simple text file that holding more than 500 IP Address,

My requirement :
bash script that will run from my central server , and will scan with nmap all the 500 ip address , for ssh port with . for example with the command : nmap -sT | grep '22.*open'

After the scan, I want him to transfer output of any address he found that SSH port is open to another text file.

What will be the effective script?

Note, I do not want him to run on subnet, only on all the ip address that found on the file.

Thank you.
# 2  
Old 05-21-2013
Quick reply

Code:
while read line
do
echo $line
Parse the line to get the IPaddress
<run nmap command for checking the >
done <"IP-Adress-File"


"The --data-length option can be used to send a fixed-length random payload to every port. If an ICMP port unreachable error (type 3, code 3) is returned, the port is closed."
Check first nmap works this way.

Last edited by Scott; 05-21-2013 at 09:41 AM.. Reason: Use code tags, please...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Locating shell script files with the $PATH variable

I've created a test script, which is located in $HOME/bin. The script runs as expected with no issues. However, upon echo'ing the $path variable the location of my script is not located in any of the directories listed in $path. So my question is, how does shell know where the script is located... (2 Replies)
Discussion started by: BrandonD
2 Replies

2. Linux

How to check CFG2HTML for Linux servers?

Hi, Could someone please let me know how to How to check CFG2HTML for Linux servers? I am new for OS end. Thanks, Vivek. (4 Replies)
Discussion started by: Viv_kadam
4 Replies

3. Shell Programming and Scripting

Shell script to change the password on multiple servers in linux

Can any one please let me know the shell script to change the password for a particular user on multiple linux servers. (2 Replies)
Discussion started by: s_madras
2 Replies

4. UNIX for Advanced & Expert Users

Script to access multiple linux servers to get system details such as CPU usage

Hi Is there any shell script that accesses multiple linux servers to get details such as CPU usage, RAM used etc. The access of the servers must be parallel not serial in the sense it must ping all the servers at a time to get information.The script has to be triggered from a host system and get... (7 Replies)
Discussion started by: mssrivatsa
7 Replies

5. Linux

Few Questions on about Linux Servers.

1.On x86 Machines ( Pentium4 ), What is the maximum number of Services( sshd, ntpd,named ,samba, etc.) that can be installed.? Is there a rule of thumb to attain the best possible performence.? 2. Is there a systematic way to boot a remote Machine.? 3. Are there any problems of having two... (2 Replies)
Discussion started by: kanata
2 Replies

6. UNIX for Dummies Questions & Answers

Fax Servers for Linux/AIX

At the company where I work, use a product called VSI-FAX. It works nicely, but the maintenance has proven to be very poor grade. So, I'm interested in any experiences using other fax servers that run on Linux or AIX and what issues/gotchas were run into and overcome and how. I'm considering... (0 Replies)
Discussion started by: kpearson
0 Replies

7. What is on Your Mind?

Microsoft servers Vs. Unix/Linux

What you have to say about the following comparison: Compare (2 Replies)
Discussion started by: tayyabq8
2 Replies

8. Gentoo

What do you use on your linux servers?

What do you use on your linux servers? What distributions? (10 Replies)
Discussion started by: DCrystal
10 Replies

9. UNIX for Dummies Questions & Answers

monitering servers in linux

how can i moniter the servers (e.g FTP, NNTP, APACHE) in linux. (4 Replies)
Discussion started by: perleo
4 Replies

10. Cybersecurity

Who uses Antivirus software on your linux servers?

So who uses antivirus software on your linux servers? A co-worker and myself have been debating on the need or lack there of for antivirus on a linux webserver running Apache even if that's the only service that may be running. He thinks no and I am of the opinion that it is needed. My rational... (1 Reply)
Discussion started by: jjvaas
1 Replies
Login or Register to Ask a Question