• Support
  • Articles
  • Resources
  • Products
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead

Trying to make the connect syntax work, about to give up - please help, anyone!

Moderator: boris

12 postsPage 1 of 1

gromgutten
Newbie

Posts:
8
Joined: Wed Sep 14, 2016 2:20 pm
by gromgutten » Wed Sep 14, 2016 2:54 pm
Okay,

So I am trying to create a macro.
I have tried the following variations for the first line in the macro:
connect 'XX.XXX.XX.XXX /ssh /auth=password /user=admin /passwd=password'
connect 'XX.XXX.XX.XXX /ssh /2 /auth=password /user=admin /passwd=password'
connect 'XX.XXX.XX.XXX /ssh /2 /auth=challenge /user=admin /passwd=password'
connect 'XX.XXX.XX.XXX /ssh /2 /auth=challenge /user=admin /ask4password'
connect 'XX.XXX.XX.XXX /ssh /2 /auth=publickey /user=admin /passwd=password keyfile=C:\Program Files (x86)\teraterm\ssh_known_hosts'
connect 'XX.XXX.XX.XXX /ssh /2 /auth=publickey /user=admin /passwd=password keyfile=ssh_known_hosts'
connect 'XX.XXX.XX.XXX /ssh /2 /auth=pageant /user=admin /passwd=password'

NONE of these work - they all give me the TTSSH connection dialogue window instead of simply getting me directly to the CLI prompt.
In addition the TTSSH connection dialogue window is "stuck" - I cannot click OK or Disconnect, it just sits there without letting me do much (I can change between keyboard interactive, keys, plaintext password, and sometimes if I do that and then manually click OK the window suddenly disappears and I am logged in. )
Also , If I wait like 30 seconds, sometimes the window disappears (possibly as a response to me clicking OK ages ago) and finally logs in...


the username is set to the correct username and the password is also set to the correct password (I have tested).
Also, the deprecated TeraTerm Menu works like a charm, and logging me straight in with no prompts or dialogues (except for the first time when the key was stored).


Have I misunderstood something?

Kind regards
Last edited by gromgutten on Fri Sep 16, 2016 6:22 am, edited 2 times in total.
gromgutten
Newbie

Posts:
8
Joined: Wed Sep 14, 2016 2:20 pm
by gromgutten » Thu Sep 15, 2016 1:02 pm
Please let me know if my question simply makes no sense - I would have expected that there was an easy and quick answer to this .. ?
IshmaelCallMe
Guru

Posts:
674
Joined: Thu Jan 26, 2006 2:28 am
by IshmaelCallMe » Thu Sep 15, 2016 2:53 pm
What version of TeraTERM?
Post entire script.
How are you starting script?

Try putting a :22 behind your IP number. This is the ssh port number.
gromgutten
Newbie

Posts:
8
Joined: Wed Sep 14, 2016 2:20 pm
by gromgutten » Thu Sep 15, 2016 3:55 pm
TeraTerm 4.9.2

I only have the first line in my script at present as I never got even that to work.
So the connect line is the only line.. :)

I run the script by either right clicking it and clicking Run in the menu that pops up witihn LogMeTT editor, or by clicking Run in the toolbar.
I cannot get the TTSSH connection dialogue window to get supressed (not show), and just make the script get me straight to the CLI prompt on the host.

In fact, I always assumed TeraTerm read the scripts line by line, one at a time -
but could the reason for my problem be simply that I need to make a closing statement in the script?

If that were the case I have wrongly believed that the values in the TTSSH connection dialogue window were passed on from the script,
while in fact Tera Term is just launching with credentials saved from earlier Tera Term sessions,
but freezing because the script isnt correctly written?

Sounds plausible to me, but I am completely newbie to scripting....

Kind regards
Last edited by gromgutten on Fri Sep 16, 2016 6:22 am, edited 1 time in total.
gromgutten
Newbie

Posts:
8
Joined: Wed Sep 14, 2016 2:20 pm
by gromgutten » Fri Sep 16, 2016 6:21 am
Okay, so if I choose auth=password I get a message saying that the authentication method is not supported by the server.
Choosing Pageant tells me that TeraTerm cannot find Pageant,
Choosing publickey makes no sense as there is no key or passphrase for the server - It only needs to be added to "trusted hosts".
If I choose challenge it kind of works, the TTSSH connection window pops up and waits for like 8 seconds and then logs me in
- however, it would be quicker for me to manually write the user and pw so I don't think this is how it is supposed to be working?
gromgutten
Newbie

Posts:
8
Joined: Wed Sep 14, 2016 2:20 pm
by gromgutten » Fri Sep 16, 2016 12:16 pm
Does anyone have any thought around my problem?
I just reinstalled Tera Term running the installer as me instead of Run as Administrator, thinking it could be some sort of permission problem or something.
The behaviour is still the same so I have concluded I am missing something very basic here.
However, ALL the examples I see around the Web use that very same connect line in their SSH scripts.. So I find this quite annoying now actually..
boris
Moderator, LogMeTT and TTLEditor developer

Posts:
1598
Joined: Sat Jan 08, 2005 2:52 pm
by boris » Fri Sep 16, 2016 2:32 pm
I'd do the following:
- Start from testing manual login without macro. That would immediately show that only challenge based SSH connection is working and there is no need to try any other methods.
- Above would also show how fast the connection is established in manual mode. I've seen many cases when the server is trying to do reverse lookup on client's IP and if DNS is not configured on the server, such attempt may introduce significant delay during connection setup.
- Another good test would be to try another Terminal emulator (Putty, SecureCRT, etc.) and see if those programs are able to login without delay.
- One more troubleshooting option is changing TTSSH LogLevel from 0 to 200 in the teraterm.ini file and attempting to connect. TTSSH.LOG file in Tera Term installation directory may show the cause of the problem. It is possible that the server's preferred ciphering method is disabled under Setup->SSH menu of Teraterm. Even if it is enabled, moving it up (increasing the priority) may help.
Thanks.
Best regards,
Boris
gromgutten
Newbie

Posts:
8
Joined: Wed Sep 14, 2016 2:20 pm
by gromgutten » Fri Sep 16, 2016 8:25 pm
Hello Boris, and thanks for pointing me in a direction.

So first, here is the situation described in detail -
The current settings in the TeraTerm Menu v1.13:
Image
brings me to the prompt in a split second, elegantly and efficient as things should be:
Image
----------------------------------------------------------------------------------------------------
This line (and all the other variations previously mentioned), when clicking Run:
Image
Brings me to this TTSSH dialogue box:
Image

The only choice that actually gets me logged in is the challenge/keyboard-interactive one, and that is also what it is already set to when the window appears. BUT I need to wait for about 10 seconds before I am finally logged in, and I do not want to see the window at all in the first place. If I choose the password option I also have to wait 10 seconds before I am told that the ssh2 endpoint does not support this mode of authentication.
----------------------------------------------------------------------------------------------------
SecureCRT works flawlessly if I use the wizard to create a session (and type the password only at the first time I initiate the saved session).
From thereon it logs me straight in with no delay and no password prompt.
The same goes for Putty.
----------------------------------------------------------------------------------------------------
Seeing as the old Tera Term Menu works perfectly as well, it is my understanding that the problem must somehow relate to the TTSSH "module". Maybe, as you say, it has to do with the cipher keys.
----------------------------------------------------------------------------------------------------
Here is the ouput from the TTSSH.LOG file:

Fri Sep 16 22:22:42.090 2016 [13188] ---------------------------------------------------------------------
Fri Sep 16 22:22:42.093 2016 [13188] Initiating SSH session
Fri Sep 16 22:22:43.940 2016 [13188] Received server identification string: SSH-2.0-OpenSSH_6.5
Fri Sep 16 22:22:43.949 2016 [13188] Sent client identification string: SSH-2.0-TTSSH/2.78 Win32
Fri Sep 16 22:22:44.288 2016 [13188] client proposal: KEX algorithm: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group18-sha512,diffie-hellman-group16-sha512,diffie-hellman-group14-sha256,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
Fri Sep 16 22:22:44.291 2016 [13188] client proposal: server host key algorithm: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-rsa,ssh-dss
Fri Sep 16 22:22:44.292 2016 [13188] client proposal: encryption algorithm client to server: camellia256-ctr,aes256-ctr,camellia256-cbc,aes256-cbc,camellia192-ctr,aes192-ctr,camellia192-cbc,aes192-cbc,camellia128-ctr,aes128-ctr,camellia128-cbc,aes128-cbc,3des-ctr,3des-cbc,blowfish-ctr,blowfish-cbc,cast128-ctr,cast128-cbc
Fri Sep 16 22:22:44.294 2016 [13188] client proposal: encryption algorithm server to client: camellia256-ctr,aes256-ctr,camellia256-cbc,aes256-cbc,camellia192-ctr,aes192-ctr,camellia192-cbc,aes192-cbc,camellia128-ctr,aes128-ctr,camellia128-cbc,aes128-cbc,3des-ctr,3des-cbc,blowfish-ctr,blowfish-cbc,cast128-ctr,cast128-cbc
Fri Sep 16 22:22:44.295 2016 [13188] client proposal: MAC algorithm client to server: hmac-sha2-512,hmac-sha2-256,hmac-sha1,hmac-ripemd160@openssh.com,hmac-md5
Fri Sep 16 22:22:44.297 2016 [13188] client proposal: MAC algorithm server to client: hmac-sha2-512,hmac-sha2-256,hmac-sha1,hmac-ripemd160@openssh.com,hmac-md5
Fri Sep 16 22:22:44.299 2016 [13188] client proposal: compression algorithm client to server: none
Fri Sep 16 22:22:44.304 2016 [13188] client proposal: compression algorithm server to client: none
Fri Sep 16 22:22:44.306 2016 [13188] SSH2_MSG_KEXINIT was sent at SSH2_send_kexinit().
Fri Sep 16 22:22:44.307 2016 [13188] SSH2_MSG_KEXINIT was received.
Fri Sep 16 22:22:44.309 2016 [13188] server proposal: KEX algorithm: curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
Fri Sep 16 22:22:44.311 2016 [13188] server proposal: server host key algorithm: ssh-rsa
Fri Sep 16 22:22:44.313 2016 [13188] server proposal: encryption algorithm client to server: aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
Fri Sep 16 22:22:44.322 2016 [13188] server proposal: encryption algorithm server to client: aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
Fri Sep 16 22:22:44.324 2016 [13188] server proposal: MAC algorithm client to server: hmac-sha1,hmac-sha2-512,hmac-sha2-256
Fri Sep 16 22:22:44.326 2016 [13188] server proposal: MAC algorithm server to client: hmac-sha1,hmac-sha2-512,hmac-sha2-256
Fri Sep 16 22:22:44.327 2016 [13188] server proposal: compression algorithm client to server: none,zlib@openssh.com,zlib
Fri Sep 16 22:22:44.329 2016 [13188] server proposal: compression algorithm server to client: none,zlib@openssh.com,zlib
Fri Sep 16 22:22:44.331 2016 [13188] KEX algorithm: diffie-hellman-group-exchange-sha256
Fri Sep 16 22:22:44.333 2016 [13188] server host key algorithm: ssh-rsa
Fri Sep 16 22:22:44.335 2016 [13188] encryption algorithm client to server: aes256-cbc
Fri Sep 16 22:22:44.337 2016 [13188] encryption algorithm server to client: aes256-cbc
Fri Sep 16 22:22:44.339 2016 [13188] MAC algorithm client to server: hmac-sha2-512
Fri Sep 16 22:22:44.341 2016 [13188] MAC algorithm server to client: hmac-sha2-512
Fri Sep 16 22:22:44.342 2016 [13188] compression algorithm client to server: none
Fri Sep 16 22:22:44.348 2016 [13188] compression algorithm server to client: none
Fri Sep 16 22:22:44.350 2016 [13188] SSH2_MSG_KEX_DH_GEX_REQUEST was sent at SSH2_dh_gex_kex_init().
Fri Sep 16 22:22:44.390 2016 [13188] SSH2_MSG_KEX_DH_GEX_GROUP was received.
Fri Sep 16 22:22:44.393 2016 [13188] DH-GEX: Request: 1024 / 8192 / 8192, Received: 8192
Fri Sep 16 22:22:44.714 2016 [13188] SSH2_MSG_KEX_DH_GEX_INIT was sent at handle_SSH2_dh_gex_group().
Fri Sep 16 22:22:50.603 2016 [13188] SSH2_MSG_KEX_DH_GEX_REPLY was received.
Fri Sep 16 22:22:50.974 2016 [13188] SSH2_MSG_NEWKEYS was sent at handle_SSH2_dh_gex_reply().
Fri Sep 16 22:22:50.977 2016 [13188] SSH2_MSG_NEWKEYS was received(DH key generation is completed).
Fri Sep 16 22:22:50.985 2016 [13188] Server reports supported authentication method mask = 65580
Fri Sep 16 22:22:50.988 2016 [13188] Entering secure mode
Fri Sep 16 22:22:50.991 2016 [13188] SSH2_MSG_SERVICE_REQUEST was sent at do_SSH2_userauth().
Fri Sep 16 22:22:51.003 2016 [13188] SSH2_MSG_SERVICE_ACCEPT was received. service name=ssh-userauth
Fri Sep 16 22:22:51.006 2016 [13188] SSH2_MSG_USERAUTH_REQUEST was sent do_SSH2_authrequest(). (method 5)
Fri Sep 16 22:22:51.034 2016 [13188] SSH2_MSG_USERAUTH_FAILURE was received.
Fri Sep 16 22:22:51.037 2016 [13188] Server reports supported authentication method mask = 65572
Fri Sep 16 22:22:51.039 2016 [13188] method list from server: publickey,keyboard-interactive
Fri Sep 16 22:22:51.041 2016 [13188] SSH2_MSG_USERAUTH_REQUEST was sent do_SSH2_authrequest(). (method 5)
Fri Sep 16 22:22:51.073 2016 [13188] SSH2_MSG_USERAUTH_INFO_REQUEST was received.
Fri Sep 16 22:22:51.113 2016 [13188] SSH2_MSG_USERAUTH_INFO_REQUEST was received.
Fri Sep 16 22:22:51.116 2016 [13188] SSH2_MSG_USERAUTH_INFO_RESPONSE was sent at handle_SSH2_userauth_inforeq().
Fri Sep 16 22:22:51.283 2016 [13188] SSH2_MSG_USERAUTH_INFO_REQUEST was received.
Fri Sep 16 22:22:51.285 2016 [13188] SSH2_MSG_USERAUTH_INFO_RESPONSE was sent at handle_SSH2_userauth_inforeq().
Fri Sep 16 22:22:51.290 2016 [13188] SSH2_MSG_USERAUTH_SUCCESS was received.
Fri Sep 16 22:22:51.293 2016 [13188] SSH2_MSG_CHANNEL_OPEN was sent at handle_SSH2_userauth_success().
Fri Sep 16 22:22:51.312 2016 [13188] User authentication is successful and SSH heartbeat thread is starting.
Fri Sep 16 22:22:51.316 2016 [13188] SSH2_MSG_CHANNEL_OPEN_CONFIRMATION was received.
Fri Sep 16 22:22:51.318 2016 [13188] SSH2_MSG_CHANNEL_REQUEST was sent at send_pty_request().
Fri Sep 16 22:22:51.324 2016 [13188] SSH2_MSG_CHANNEL_SUCCESS was received(nego_status 2).
Fri Sep 16 22:22:51.327 2016 [13188] SSH2_MSG_CHANNEL_REQUEST was sent at handle_SSH2_channel_success().
Fri Sep 16 22:22:51.334 2016 [13188] SSH2_MSG_CHANNEL_WINDOW_ADJUST was received.
Fri Sep 16 22:22:51.341 2016 [13188] SSH2_MSG_CHANNEL_SUCCESS was received(nego_status 3).
Fri Sep 16 22:22:51.401 2016 [13188] SSH2_MSG_CHANNEL_DATA was received. local:0 remote:0
Fri Sep 16 22:22:51.408 2016 [13188] SSH2_MSG_CHANNEL_DATA was received. local:0 remote:0
----------------------------------------------------------------------------------------------------

Any thoughts?
What I want to achieve is to supress the TTSSH Window from appearing alltogether, and to get straight to the command prompt without the 10sec delay....

Kind regards
Last edited by gromgutten on Sat Sep 17, 2016 3:52 am, edited 1 time in total.
boris
Moderator, LogMeTT and TTLEditor developer

Posts:
1598
Joined: Sat Jan 08, 2005 2:52 pm
by boris » Fri Sep 16, 2016 9:10 pm
Thanks.
Best regards,
Boris
gromgutten
Newbie

Posts:
8
Joined: Wed Sep 14, 2016 2:20 pm
by gromgutten » Sat Sep 17, 2016 3:49 am
Hello again Boris,

I believe you are right about the connection in TeraTerm Menu in fact being a Telnet connection in the screenshot.
When I ticked "Use SSH" the same behviour was seen there as well..... Sorry abut that, my fault.
I was not aware that the host had Telnet enabled so the thought simply did not occur to me.

However, for both SecureCRT and for Putty, SSH was used, and those clients log me in in a split second.
SSH is what I need and want to work just as quick and elegantly when using macros for Tera Term ;)

From the log included one can see that there is a gap in time from 22:22:44.714 to 22:22:50.603 (6 seconds) which I believe accounts for most of the annoying delay...
I also would also love to supress the connection window alltogether...
boris
Moderator, LogMeTT and TTLEditor developer

Posts:
1598
Joined: Sat Jan 08, 2005 2:52 pm
by boris » Sat Sep 17, 2016 4:50 am
Based on your log, 6 sec delay is caused by the server. Tera Term sends SSH2_MSG_KEX_DH_GEX_INIT and it takes 6 seconds to get back SSH2_MSG_KEX_DH_GEX_REPLY from the server. I'd try to trace with Wireshark connections established by Putty and Tera Term and compare the traces. There should be a difference.
Unfortunately my expertise ends here. If the traces are identical, than, hopefully, someone from Tera Term Project team will respond this post with a suggestion or a solution.
Thanks.
Best regards,
Boris
gromgutten
Newbie

Posts:
8
Joined: Wed Sep 14, 2016 2:20 pm
by gromgutten » Sat Sep 17, 2016 6:35 am
Hello Boris,

I just wanted to say thank you for your time, and thank you for making LogMeTT!

I have verified 100% that I am indeed using SSH when testing with the other clients BTW...
- So there IS a difference from the user experience perspective when it comes to the long time delay.
I will make some further analysis with Wireshark when I have some more time, and if/when that happens I will post the results here.
In any event I guess its a luxury problem, its just one of those things that end up being inherently annoying :D

Kind regards
Display posts from previous:
Sort by:

12 postsPage 1 of 1

Users browsing this forum: No registered users