Jump to content
Sign in to follow this  
DanHawker

Escape Password Strings

Recommended Posts

DanHawker

Hi All,

Am attempting to put together a quick front-end to enable the team here to access our UNIX boxes from PuTTY. We use a SSH gateway and bastion host arrangement, so to login to a server, you need to access the GW, then the bastion and finally the server. Obviously lots of typing of the same details is required and is obviously prone to error.

Have got something that works (simple GUI with hostname, username and password fields) however I need the password field to support all and any characters (we have quite a stiff password policy), so for instance Ev!lPassword.

If I hardcode the password in (for testing) I can get it to work by simply using Send() and escaping any random characters (eg Send("Ev{!}lPassword{ENTER}"), however this isn't how it is entered in the GUI so it doesn't work the same.

Have tried...

Send("Ev!lPassword" & "{ENTER}"), adding the raw flag and other permutations to try and get it to work, but without success.

Is there a way of escaping the entire string to then place into Send(), or is there some other mechanism to make this work (convert to ASCII and send the lot as an ASCII string for example). I suppose you could get it to iterate over the entire string, escaping specific chars, but that seems very kludgy to me.

Any ideas???

Thanks

Dan

Share this post


Link to post
Share on other sites
Alek

Send($Password,1)

Send("{ENTER}",0)


[font="Impact"]Never fear, I is here.[/font]

Share this post


Link to post
Share on other sites
DanHawker

Send($Password,1)

Send("{ENTER}",0)

Doh!!! (hitting head with hand)

Didn't realise it was that simple. Read the bit about sending it raw, but kept including the {ENTER} too.

Thanks Alek

Dan

Share this post


Link to post
Share on other sites
preethiraj
On 8/12/2009 at 8:51 PM, Alek said:

 

Send($Password,1)

Send("{ENTER}",0)

 

Thankyou Alek. you solved my big problem.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×