- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- SSH Issue
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
03-24-2009 07:37 AM
03-24-2009 07:37 AM
SSH Issue
I have big list of servers and I have to loop through all the servers and extract some data needed, everything else is working fine but
When i do
___________
ssh $i "some commands" #$i=server_name
it ask for password for some of the servers out of many
______________
I do understand, some of the servers from the list may not be valid or some of the servers many not have ssh set up for my account or any account
________
but how can i skip those situations because my program just stuck asking for password. I want if that happens then go for the next server in the list and put the name of those not working ones in some other text file or log file.
Here the code I have
_______________
#!/usr/bin/ksh
req_info()
{
for i in ` cat server_list_old`
do
echo $i
if [ $i = "bhpflp1a" ]
then
continue
fi
ssh $i grep $i /usr/local/syncsort_3.4/license.dat > tmp1
if [ $? = 0 ]
then
ssh $i "cd /usr/local/syncsort_3.4/bin/;./sysenv|grep CPUs">tmp2
echo $i ` awk '{print $4, $5}' tmp1` permanent `awk '{print $1,$2,$3,$4,$5}' tmp2`| tee -a result
else
ssh $i "cd /usr/local/syncsort_3.4/bin/;./sysenv|grep CPUs">>tmp2
ssh $i grep SyncSort /usr/local/syncsort_3.4/license.dat > tmp1
echo $i `awk '{print $4, $5}' tmp1` temporary `awk '{print $1,$2,$3,$4,$5}' tmp2`| tee -a result
fi
done
rm -f tmp2 tmp1
}
req_info
__________________
Here, you can see I can skip the servers if I know in advance but I wont know in the beginning for most of the case, situation can be like the working server may have some problems sometime and ask for password also. Just trying to handle the situation.
Any Idea Plz
Thank You,
Any Help will be appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2009 08:00 AM
03-24-2009 08:00 AM
Re: SSH Issue
You should enable passwordless login for your account in all the servers to use script to execute some commands on remote servers.
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2009 08:04 AM
03-24-2009 08:04 AM
Re: SSH Issue
There are many threads available here on ssh password less login. you can search with ssh passwordless keywords.
One among is
http://forums12.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1221495337406+28353475&threadId=1223480
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2009 08:05 AM
03-24-2009 08:05 AM
Re: SSH Issue
http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/internet/node31.html
for passwordless login
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2009 08:11 AM
03-24-2009 08:11 AM
Re: SSH Issue
I dont want my program to stuck asking for password, instead skil the servers which ask for password and put that servers name in a file so that I can trace later on.
Problem can be if the name of the server is not valid, then wont ask for password and stuck but says
ssh: Could not resolve hostname bhtokan: host nor service provided, or not known
I think its clear now.
I am talking about two situations
-----one ssh is not setup for certain servers and
------another invalid servername
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2009 12:15 PM
03-24-2009 12:15 PM