- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Expect and SFTP
Categories
Company
Local Language
Forums
Discussions
- Integrity Servers
- Server Clustering
- HPE NonStop Compute
- HPE Apollo Systems
- High Performance Computing
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp Software
Knowledge Base
Discussions
Forums
Discussions
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
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"