Forum

Scripting with SSH2...
 
Notifications
Clear all

Scripting with SSH2?

0 Posts
3 Users
0 Reactions
336 Views
(@sywyatt)
Eminent Member
Joined: 18 years ago
Posts: 23
Topic starter  

I have created an automatic login script (very similar to your example on the web site) for use with an SSH2 server, but I'm confused by the behavior. When I double-click the .tnt file that contains the login script, the "SSH2: Authentication" dialog box appears. A few seconds later the Timeout error MsgBox from my auto-login script appears. If I then enter my username and password into the SSH2: Authentication box, I am logged in successfully.

Is there a way to disable the display of the SSH2: Authentication dialog and force the "Login:" and "Password:" prompts from the SSH server to be passed through, so that my script can respond to the prompts? Or is it not possible to use an auto-login script with SSH2?

Steve Wyatt


   
ReplyQuote
(@bpence)
Member Admin
Joined: 12 months ago
Posts: 1375
 

Login scripts are not necessary for SSH authentication. Authentication is already part of the SSH protocol. What you should do is delete the login script and use the login dialog box. Check the 'remember password' option and you won't get this dialog every time.

You can still use the login script to execute things in the shell, but you can skip the username/password part of it.

Brian


   
ReplyQuote
(@sywyatt)
Eminent Member
Joined: 18 years ago
Posts: 23
Topic starter  

Hi Brian:

Thank you for the (after hours) response.

I opened my .tnt file and deleted the login script then closed AT (and saved the changes).

Next, I double-clicked my .tnt file and entered my Username and Password on the SSH2: Authentication dialog, then checked the "Remember Password" checkbox, then selected "OK". That logged me in to the server.

However, after I logged out and closed AT, I double-clicked the same .tnt file again, and the SSH2: Authentication dialog box appeared, but the Username and Password fields were blank. Selecting "OK" resulted in a "You must supply a username" error box.

Steve Wyatt


   
ReplyQuote
(@bpence)
Member Admin
Joined: 12 months ago
Posts: 1375
 

No problem.

After you supply the username and password and check the 'remember password' box, you must still click File->Save to save all of the config information back to the file to use it again next time.

Brian


   
ReplyQuote
(@sywyatt)
Eminent Member
Joined: 18 years ago
Posts: 23
Topic starter  

Brian:

Thanks again for the response.

I double-clicked my .tnt file, entered the Username and Password, checked the "Remember Password", selected OK (which logged me in), then did File...Save. Next, I did "exit" to log off of the Linux server, and answered "yes" to the AT "Do you want to exit?" dialog.

After that I double clicked that same .tnt file, and up came the SSH2: Authentication dialog with blank Username and Password fields.

Steve Wyatt


   
ReplyQuote
(@bpence)
Member Admin
Joined: 12 months ago
Posts: 1375
 

Check the authentication options on the Options->Properties->Connection->SSH2 page. Make sure 'use last username' is selected and not 'prompt for username'. 'prompt for username' will *ALWAYS* prompt for username/password, even if you previously selected 'remember password'.

Brian


   
ReplyQuote
(@sywyatt)
Eminent Member
Joined: 18 years ago
Posts: 23
Topic starter  

Brian:

Thanks again. That was the answer I needed.

We work too much, don't we.

Steve Wyatt


   
ReplyQuote
(@bpence)
Member Admin
Joined: 12 months ago
Posts: 1375
 

Way too much.... 🙁


   
ReplyQuote
(@sywyatt)
Eminent Member
Joined: 18 years ago
Posts: 23
Topic starter  

Thanks again Brian.

Steve Wyatt

😉


   
ReplyQuote
(@drussell)
Active Member
Joined: 21 years ago
Posts: 7
 

Hi Brian,

I am using ver 9.15 and don't have an option for using the last username on the SSH2 page. its there for SSH1.

Is this deprecated in this version?

David


   
ReplyQuote
(@bpence)
Member Admin
Joined: 12 months ago
Posts: 1375
 

That's very odd. Can you give me a screen snapshot?

Brian


   
ReplyQuote
Share: