- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- Re: how to provide password in case of batch files...
Operating System - Microsoft
1754366
Members
4746
Online
108813
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-28-2006 08:59 PM
02-28-2006 08:59 PM
Re: how to provide password in case of batch files(ssh protocol)
so, as Michael Selvesteen said,
I think you should use expect
http://expect.nist.gov
I think you should use expect
http://expect.nist.gov
share share share
- 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)
Expect is a very nice way to create interaction with the shell for automation
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,
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,
- « Previous
-
- 1
- 2
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP