LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 06: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-14-2007, 11:10 PM   #2
XaViaR
Member
 
Registered: Dec 2004
Distribution: RHEL, CentOS, SuSE
Posts: 170

Rep: Reputation: 31
Is this a homework problem?
 
Old 03-16-2007, 11:38 AM   #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



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 11:41 AM
iptables help! DROP ssh port, but allow to connect to ssh if from 2222 port kandzha Linux - Networking 4 09-13-2006 09:10 AM
ssh + pop3 with kmail: Could not connect to host localhost, but ok without ssh Emmanuel_uk Linux - Networking 0 07-20-2006 04:56 PM
SSH Won't allow me to connect predator.hawk Slackware 16 11-09-2004 12:53 PM
Can't connect via ssh _TK_ Linux - Networking 3 04-27-2001 06:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:16 AM.

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
Open Source Consulting | Domain Registration