- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script needed to test SSH trusts
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-24-2006 07:15 AM
08-24-2006 07:15 AM
Script needed to test SSH trusts
All these servers should trust the server running the script. Should...
Occasionally there are problems where the password expires or the account locks out. The server will then prompt for a password, at which point my script would hang forever.
I need some procedure to call or command to invoke for each server that would test to make sure login was possible, i.e. that the trust is working, BEFORE it scps. So far I've been unable to find anything that will do this and I'm not handy with TCL or Perl enough to do this.
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2006 07:26 AM
08-24-2006 07:26 AM
Re: Script needed to test SSH trusts
otherwise, you can generate ssh keys and copy pub key to authorized_keys file and copy it to server:/home/userid/.ssh directory and it won't ask for password.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2006 07:32 AM
08-24-2006 07:32 AM
Re: Script needed to test SSH trusts
I can fix the keys, but I would want to know when it fails.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2006 07:32 AM
08-24-2006 07:32 AM
Re: Script needed to test SSH trusts
NumberOfPasswordPrompts 0
then it will skip those servers that prompt for passwd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2006 07:35 AM
08-24-2006 07:35 AM
Re: Script needed to test SSH trusts
$? will be non 0 thus you can check it.
for server in list
do
scp stuff here
[[ $? != 0 ]] && echo "$server failed"
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2006 07:42 AM
08-24-2006 07:42 AM
Re: Script needed to test SSH trusts
Also, can I create an alertnate config file called only by this script? I don't normally want to ignore password prompts, only when this script runs.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2006 07:51 AM
08-24-2006 07:51 AM
Re: Script needed to test SSH trusts
I don't think you can make an alternate config file. But I am not 100% sure.
You could simply have a config.scp_script and mv it into and out of place at the beginning and end of your script so it is only there while the script runs.
you might be able to pass the option on the command line also with the -o option, then you wouldn't need the config file at all.
scp -o NumberOfPassword_Prompts 0 .....
I have never tried that you can check scp man page to make sure it will work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2006 07:52 AM
08-24-2006 07:52 AM
Re: Script needed to test SSH trusts
I don't think you can make an alternate config file. But I am not 100% sure.
You could simply have a config.scp_script and mv it into and out of place at the beginning and end of your script so it is only there while the script runs.
you might be able to pass the option on the command line also with the -o option, then you wouldn't need the config file at all.
scp -o NumberOfPasswordPrompts 0 .....
I have never tried that you can check scp man page to make sure it will work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2006 07:53 AM
08-24-2006 07:53 AM
Re: Script needed to test SSH trusts
loramab00001001:/oracle/admin/dmdbdr/adhoc $ ssh2 -F /oracle/.ssh2/script_ignore_prompt_config aorarib00001q01
warning: Configuration option NumberOfPasswordPrompts is deprecated.
This is a proprietary system requiring authorized access. Any unauthorized
access and/ or use of this system is not permitted. Any authorized use is
subject to compliance with applicable law and corporate policies, as may be
amended from time to time. Accordingly, this system may be monitored and
the results recorded and reviewed. By using or accessing this system, you
expressly acknowledge that you are an authorized user and are not entitled
to any privacy rights with respect to your use of this system.
oracle's password:
Received signal 2. (no core)
[User:oracle Sid:dmdbdr]
loramab00001001:/oracle/admin/dmdbdr/adhoc $
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2006 07:53 AM
08-24-2006 07:53 AM
Re: Script needed to test SSH trusts
ssh -o NumberOfPasswordPrompts=0 server cmds
So scp should be take it also.
hope that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2006 08:00 AM
08-24-2006 08:00 AM
Re: Script needed to test SSH trusts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2006 01:39 PM
08-24-2006 01:39 PM
Re: Script needed to test SSH trusts
$ ssh -o NumberOfPasswordPrompts=0 192.168.0.3
(publickey,gssapi-with-mic,password).
$ echo $?
255
$
I do have a slightly older verison of ssh though.
$ ssh -v
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2006 12:48 AM
08-25-2006 12:48 AM
Re: Script needed to test SSH trusts
-o BatchMode=yes
That successfully skips any password requests.