- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- scp script prompted a password
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
Discussions
Discussions
Discussions
Forums
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
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
тАО02-02-2005 06:27 PM
тАО02-02-2005 06:27 PM
I have a script using scp with private/public keys that pull a file from around 500 servers. The script was stuck because 1 or 2 servers was not configured with proper keys and requested a password. I have to type the password manually, so that the script can continue running. How can I give the password automatically without doing it manually? or how can I skip those servers, so that the script can continue running? Is there any scp option to skip the password?
Please help. High score will be given.
Warning: Permanently added 'sihp8025,15.12.11.34' (RSA) to the list of known hosts.
secumgr@sihp8025's password:
Thanks and Best Regards,
Dewa
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2005 06:46 PM
тАО02-02-2005 06:46 PM
Re: scp script prompted a password
Did you use ssh-keygen2 (as the secumgr user on the central server) to generate the public key and enter a blank catchphrase during the key generation?
Then did you copy that public file to the remote system and add it's reference to the authorization file in the user's $HOME/.ssh2 folder (on the remote server)?
Best regards - Keith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2005 07:01 PM
тАО02-02-2005 07:01 PM
Re: scp script prompted a password
Thanks.
Yes I did it. Most of servers were running well. What I want is that if there is a server missed the public key on ~/.ssh (for instance deleted by mistaken) when the script is running, this server will prompt a password. How can we skip this server, so the script still can be running.
Pls help.
Thanks.
Dewa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2005 07:19 PM
тАО02-02-2005 07:19 PM
SolutionI have a similiar job run from cron and do a test first (yours would look like this, if run from the root cron):
su secumgr -c "/usr/local/bin/ssh2 -l secumgr sihp8025 ls -al >/dev/null 2>&1"
retc=$?
if [ $retc -ne 0 ]
then
echo "Not accepting remote connections"
else
echo "Up and accepting connections"
# Anything else to do goes here
fi
Keith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2005 11:06 PM
тАО02-02-2005 11:06 PM
Re: scp script prompted a password
Hope this helps,
-denver
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2005 11:17 PM
тАО02-02-2005 11:17 PM
Re: scp script prompted a password
for NODE in `cat hosts.txt`
do
echo sending $FILE to $NODE >>/tmp/scp.log
scp -i ${KEY}/${NODE} -o StrictHostKeyChecking=no -B /path/myfile ${NODE}:/path/myfile 2>/tmp/err.log 1>/tmp/scp.log
if [ $? -eq 0 ];then
echo copy to $NODE complete >>/tmp/scp.log
else
echo copy to $NODE failed >>/tmp/scp.log
fi
done
Where $KEY is the path to the public keys you use for the target hosts. ex/ ~/.ssh/keys/ dir could contain seperate public/private key pairs for all targets. Easy way to store them is by naming the pub/priv key the hostname. If you use the same public/private key pair for all nodes, use "-i /path/key_file" in the example I showed above.
Hope this example helps,
-denver