- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Monitoring if ssh works
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2010 12:19 AM
08-09-2010 12:19 AM
I have a setup of around 100 servers with atleast 10 users on each box.The public key from one server has been created and updated on all other servers , so that passwordless login can be done from any use.
We recently had a problem that ssh keys on one of the system was changed and scripts using ssh failed.
I want to come up with a bash script to check if ssh is successful from one server to all servers using all users (All permutations and combinations)
Any ideas would be appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2010 03:49 AM
08-09-2010 03:49 AM
Re: Monitoring if ssh works
if not, just su to the user and ssh to all serverslike
cat /tmp/list
server1
server2
serveretc
=======
su - user
cat /tmp/list|while read line
do
ssh $line uname -a
done >> /tmp/file
and check the /tmp/file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2010 03:55 AM
08-09-2010 03:55 AM
Re: Monitoring if ssh works
Host_name_list="path of the file which has hostnames"
User_name_list="path of the file which has usernames"
Log_file="path to the file which would contain all the ssh log entries"
for host_name in $Host_name_list
do
for user in $User_name_list
do
ssh -q -o "BatchMode=yes" ${user}@${host} "echo 2>&1" && echo "Successful for" $user@$host_name\
|| echo "Failed for" $user@$host_name"
done
done
mailx -s "This is it" rohit.khaladkar@xyz.com < $Log_file
Is there a better way out..?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2010 10:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2010 11:08 AM
08-09-2010 11:08 AM
Re: Monitoring if ssh works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2010 12:18 PM
08-09-2010 12:18 PM
Re: Monitoring if ssh works
> each system to detect when something
> changed on the systems.
Sometimes it's useful to test the actual
thing which you care about. It may be
possible to use X-rays or neutrons or
ultrasonic sound or eddy currents, or any
number of other methods, to test a hammer,
but it's often easier and more reliable just
to hit a nail with the thing, and see what
happens. There are advantages to "simple and
direct".