- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Expect/SFTP fails when password contains '#'
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
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
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
04-09-2008 09:50 AM
04-09-2008 09:50 AM
The vendor I am downloading files from has assigned me
an id/password and the password contains a #.
I have set up a test in my office (two hp-ux servers) and
it works fine except when there is a # in the password.
I have tried escaping the # with \# and even using an
octal representation, \043, but the login still fails.
output with debug, password is #abc123....
expect: set expect_out(spawn_id) "exp7"
expect: set expect_out(buffer) " sftp2\r\n331 Password required for sftp2.\r\nPassword:"
send: sending "#abc123" to { exp7 }
tty_raw_noecho: was raw = 0 echo = 1
spawn id exp0 sent <\r>
spawn id exp7 sent <\r\n>
spawn id exp7 sent <530 Login incorrect.\r\n>
530 Login incorrect.
spawn id exp7 sent
Login failed.
I know I could request the password contain no # but I am
curious why this fails. Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2008 10:49 AM
04-09-2008 10:49 AM
Re: Expect/SFTP fails when password contains '#'
"WARNINGS
Avoid password characters which have special meaning to the tty driver, such as # (erase) and @ (kill). You may not be able to login with these characters."
That seems to be exactly what you're experiencing!
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2008 11:02 AM
04-09-2008 11:02 AM
Solutionhttp://forums12.itrc.hp.com/service/forums/questionanswer.do?threadId=1214938
I think you're on the right track w/ the "escape"....but you may need more than one. Depends on how the shells and expect are interacting..something like '\\\#abc123' or '\\\\#abc123' perhaps?
The next hurdle would be, what happens at the vendor's login. My guess is that it will behave differently, since they sent you a password with a "#" in it to begin with.
If you login via telnet from HP to HP at the office, a single '\' should suffice, so doubling it in the script *ought* to get it. If it does, then what happens at the vendor server? does in require 0 or 1 escapes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2008 03:43 PM
04-09-2008 03:43 PM
Re: Expect/SFTP fails when password contains '#'
when logging in interactively (without expect) sftp takes the # OK.
However, when using the double escape, \\#abc123, in the script, dbug showed \#abc123 being sent and the login worked!
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2014 12:59 PM
08-06-2014 12:59 PM
Re: Expect/SFTP fails when password contains '#'
Thanks! Worked for me. I had a hashtag in my password and the sftp expect script was failing. But after escaping it out with two slashes it works.
Changed my#password
to: my\\#password
and it works!
Thanks much!
Phil