LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-14-2007, 07:02 AM   #1
Mp_3
LQ Newbie
 
Registered: Mar 2007
Posts: 2

Rep: Reputation: 0
SSH connect script


Hawaii to Everyone!

I would like to make a script, that would go and connect to a remote computer over ssh, and would display the following things for me:
cat /etc/issue.net
uname -i
who

then exit

I also would like to run this script 30 times checking a different ip every time like from 192.168.0.100-130

Any recommendation to do this?

Thanks for the help
 
Old 03-15-2007, 12:10 AM   #2
XaViaR
Member
 
Registered: Dec 2004
Distribution: RHEL, CentOS, SuSE
Posts: 170

Rep: Reputation: 31
Is this a homework problem?
 
Old 03-16-2007, 12:38 PM   #3
pokemaster
Member
 
Registered: Apr 2005
Location: Massachusetts, USA
Distribution: debian,ubuntu,slackware
Posts: 110

Rep: Reputation: 17
Easy. one liner.
Code:
i=100; while [[ $i -lt 131 ]]; do ssh -f 192.168.0.$i 'cat /etc/issue.net; uname -i; who' ; i=$(( i + 1 )); done
Hope you have pubkey auth to all these machines, man, or you'll be getting awfully tired of punching in your password.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use ssh to connect to xp bhert SUSE / openSUSE 10 09-20-2006 12:41 PM
iptables help! DROP ssh port, but allow to connect to ssh if from 2222 port kandzha Linux - Networking 4 09-13-2006 10:10 AM
ssh + pop3 with kmail: Could not connect to host localhost, but ok without ssh Emmanuel_uk Linux - Networking 0 07-20-2006 05:56 PM
SSH Won't allow me to connect predator.hawk Slackware 16 11-09-2004 01:53 PM
Can't connect via ssh _TK_ Linux - Networking 3 04-27-2001 07:16 PM


All times are GMT -5. The time now is 09:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration