- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Expect and SFTP
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
тАО09-17-2009 10:35 AM
тАО09-17-2009 10:35 AM
I am being prompted for a password each time and would think I can use "expect" to put this in my batch script. However, I am new to expect and cannot find an example on how to use this. man pages for expect didn't really help. Does anyone have an example on how to pass the password to sftp using expect?
Thanks,
Dave
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2009 10:59 AM
тАО09-17-2009 10:59 AM
Solutionnever used it before but perhaps http://www.unix.com/shell-programming-scripting/21466-automating-sftp-expect.html helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2009 11:10 AM
тАО09-17-2009 11:10 AM
Re: Expect and SFTP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2009 11:33 AM
тАО09-17-2009 11:33 AM
Re: Expect and SFTP
Both worked great.
I was unsure of syntax, but examples you sent cleared it up. Also noted some gotcha's.
Thanks to you both.
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2009 09:32 AM
тАО09-18-2009 09:32 AM
Re: Expect and SFTP
I have a similar project, do you mind sharing your scripts to me please.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2009 09:42 AM
тАО09-18-2009 09:42 AM
Re: Expect and SFTP
#!/usr/local/bin/expect --
set timeout 200
spawn /usr/bin/sftp -oPort=10022 username@sftp.11.22.33.gov
expect "username@sftp.11.22.33's password:"
send "password\r"
expect "sftp> "
send "lcd /tmp/ \r"
expect "sftp> "
send "get file \r"
expect "sftp> "
send "bye \r"