- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- how to provide password in case of batch files(ssh...
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-27-2006 04:47 PM
тАО02-27-2006 04:47 PM
how to provide password in case of batch files(ssh protocol)
I m new to this forum .
Need to know the procedure to provide the password in case of batch files , also i m working on ssh protocol .
What i m trying is given below::
IF "%1"=="" GOTO :END
SET PASSWD=%1
CALL otherbat
:END
REM maybe echo a warning that everything else will not work properly
REM because of a missing password
OTHERBAT.BAT
echo %PASSWD%| ssh root@
OR
echo "PASSWD">ssh IP -l root
Problem:: It is not accepting the password, everytime i m supposed to enter the same manually .
regards,
manoj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2006 04:56 PM
тАО02-27-2006 04:56 PM
Re: how to provide password in case of batch files(ssh protocol)
have a look at this thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=190528
hope this helps!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2006 07:46 PM
тАО02-27-2006 07:46 PM
Re: how to provide password in case of batch files(ssh protocol)
actually i don't want to disable the password prompt .
Also, i want to use the same in windows .
Need to know the procedure to provide the password .
regards,
manoj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2006 08:56 PM
тАО02-27-2006 08:56 PM
Re: how to provide password in case of batch files(ssh protocol)
((insert lecture about hard coded password here))
I couldn't tell if you start you client from Unix or DOS.
I haven't seen any way to send password from Unix.
however if you are using putty,
there is a -pw option which might help you.
Jean-Yves Picard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2006 09:04 PM
тАО02-27-2006 09:04 PM
Re: how to provide password in case of batch files(ssh protocol)
Like FTP, SSH will not accept password from a batch file. My suggestion is to set up public key authentication between those machines. Else if security of your password is not a concern for you, then an expect script can automate your ssh login.
A simple search in this forum about public key authentication will result in number of threads explaining how to set up public authentication.
Also you can try man ssh, scp and sftp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2006 09:09 PM
тАО02-27-2006 09:09 PM
Re: how to provide password in case of batch files(ssh protocol)
It' really nice to hear from u guys-- .
Actually i don't want to use any tool like putty, cygwin, SSHSecureShellClient-3.2.9b283 etc.. .
I just want to execute one simple command using windows platform-
i.e. ssh -T root@
and want to provide the password through my program .
Presently i m using batch files .Need to know the procedure / hint --how to provide the password .
regards,
manoj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2006 07:32 PM
тАО02-28-2006 07:32 PM
Re: how to provide password in case of batch files(ssh protocol)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2006 07:37 PM
тАО02-28-2006 07:37 PM
Re: how to provide password in case of batch files(ssh protocol)
Actually i m using OpenSsh . I have pasted the dll' and ssh.exe in the system32 folder of Windows .
Now, i can run the ssh.exe from any directory .
regards,
manoj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2006 08:14 PM
тАО02-28-2006 08:14 PM
Re: how to provide password in case of batch files(ssh protocol)
I would install a ssh client and configure a publickey authentication:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=999102
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2006 08:21 PM
тАО02-28-2006 08:21 PM
Re: how to provide password in case of batch files(ssh protocol)
It' nice to see yr quick replies .
I need a mechanism to provide the password .
Public key authentication is basically for password-less-login (as per my knowledge).
I am using windows platform and i want to execute a single ssh command, also i want to provide the password through my program .
That' all from my side---
regards,
manoj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2006 08:59 PM
тАО02-28-2006 08:59 PM
Re: how to provide password in case of batch files(ssh protocol)
I think you should use expect
http://expect.nist.gov
- Tags:
- expect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-01-2006 01:13 AM
тАО03-01-2006 01:13 AM
Re: how to provide password in case of batch files(ssh protocol)
I would use expect to handle the issue.
In the script below I am using scp to scp a file from one server to another.
#!/usr/local/bin/expect
spawn /usr/local/bin/scp -v /tmp/*apphire.txt user@IPADDRESS:/tmp
expect "user@IPADDRESS's password:"
send "password\r"
expect "debug: uninitializing event loop"
send "\r"
For your case
#!/usr/local/bin/expect
spawn ssh root@IPADDRESS
expect "user@IPADDRESS's password:"
send "password\r"
expect "Authentication successful."
send "\r"
Download expect and give it a try,