SSH

Posted by Syphon on Tue 16 Jan 2007 06:00 AM — 21 posts, 96,738 views.

#0
Hello, I'm trying to connect to one of my shell account via SSH with MushClient. I have read about stunnel and have tried to install it and get it to work but I keep getting this error: Failed to open configuration file stunnel.conf.
When my stunnel.conf was created by me is placed in c:/stunnel
Any Idea's ?

stunnel.conf

client = yes
output = logfile.txt

[presidium]
connect = presidium.org:22
accept = localhost:5555
Australia Forum Administrator #1
Is that the directory with stunnel.exe in? I think it looks in the directory that the executable is in.
#2
Yes It is.
Australia Forum Administrator #3
Have you accidentally called it stunnel.conf.txt? With some text editors they append a .txt to the name.

Make sure you can see filename extensions, to check this.
USA #4
Yes, its pretty much 100% certain that this will happen if you are using an MS product or they based their behaviour on MS standards. Basically, if you are using something like Notepad or even Word, to save the file you must use "stunnel.conf" *not* stunnel.conf. The "" forces the application to ignore its default type (if its not written by a moron) and use *your* exact name instead. If you don't use "", it presumes that you are saving the degfault type and automatically adds that to the end of the file. So, in Word it would produce 'stunnel.conf.doc', in notepad, 'stunnel.conf.txt', etc. Its a really annoying, but common issue.

Also, in some, if they give you the option to change the type listed in the box above the file name to *.*, it *may* also save it with your name, instead of the one it normally would, though that isn't always the case.
#5
Thanks, That solved my problem :)
#6
I got it to work now, But not completely. I'm trying to login my shell account in a buddies box via ssh, using MushClient.
But when I quick connect localhost 5555 It connects then quickly disconnects. When I connect to presidium.org 22 It connects and displays:
SSH-2.0-OpenSSH_4.1p1 Debian-6
And When I hit enter or try to enter my user name this happens and disconnects:
Protocol mismatch.
USA #7
It's not surprising that connecting directly to port 22 doesn't work, because MUSHclient doesn't speak any SSH protocol.

What's a little more surprising is that connecting to localhost 5555, which presumably is connecting to remote host 22, does nothing. I think that stunnel has a log window of sorts if you click on the tray icon; does it have any error messages?

Out of curiosity, has anyone done this successfully before? Something about it bothers me a little bit, because an SSH tunnel normally connects to a remote machine using SSH, and then tunnels your connection to *another* connection on the remote machine.

E.g. you --> localhost:5555 --> remoteserver:22 (SSH tunnel --> remoteserver:5901 (vnc)
Australia Forum Administrator #8
If you look in the logfile (logfile.txt in your case) you should see some messages. When I tried it I got:


2007.01.23 07:56:53 LOG7[3636:3596]: SSL state (connect): before/connect initialization
2007.01.23 07:56:53 LOG7[3636:3596]: SSL state (connect): SSLv3 write client hello A
2007.01.23 07:56:53 LOG7[3636:3596]: SSL alert (write): fatal: handshake failure
2007.01.23 07:56:53 LOG3[3636:3596]: SSL_connect: 1408F10B: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number


The "wrong version" appeared to be the problem, so I did some research, and added this line to the stunnel.conf file:


sslVersion = SSLv2


That appeared to eliminate the error message, but then it connected and just did nothing for a while before disconnecting.

I suspect that the username/password negotiation is not working, nor do I know how to make it work.

If I may suggest, if you simply want to connect as a shell to a SSH-secured server, simply use PuTTY, as that definitely works:

http://www.putty.nl/download.html

#9
As near as I can tell, I'm doing everything right after meticulously following http://www.gammon.com.au/mushclient/stunnel.htm

There were a few changes here and there, so I'm not sure if this makes the difference. I had to go to the openssl website and download the version of the file mentioned, which did not contain all the components listed (libssl32.dll, libeay32.dll and openssl.exe), but I figured I'd try anyway.

Launching stunnel after doing all the configuration gave me the following result in the log:

2012.10.19 09:28:09 LOG5[5624:4220]: Reading configuration from file stunnel.conf
2012.10.19 09:28:09 LOG5[5624:4220]: FIPS mode is enabled
2012.10.19 09:28:09 LOG5[5624:4220]: Configuration successful

That looked about as good as I could hope, but MushClient seems unable to connect to 'localhost' on port '5555' as I designated (again following the isntructions blindly):

Unable to connect to "MyMUDStunnel", code = 10061 (Connection refused)

Error occurred during phase: Connecting to world: 127.0.0.1, port 5555

For assistance with connection problems see:
http://www.gammon.com.au/forum/?id=8369

Any guess where my disconnect may lie?

Oh, and I should note that I'm able to connect this SSH thing with PuTTY without a problem.
Amended on Fri 19 Oct 2012 05:03 PM by ErockMahan
Australia Forum Administrator #10
So I can attempt to reproduce this, can you post the contents of your stunnel.conf file.

On my tutorial page it was:


client = yes
output = logfile.txt

[mymuck]
connect = mymuck.mymucksdomain.com:8989
accept = localhost:5555

[mysecond]
connect = othermuck.com:4205
accept = localhost:5556


Presumably yours is different. In particular I need to know what MUD you are connecting to.
#11
client = yes
output = logfile.txt

[Imperial]
connect = imperial.modeemi.fi:22
accept = localhost:5555



Amended on Fri 19 Oct 2012 11:38 PM by ErockMahan
Australia Forum Administrator #12
Can you give a link to the website?

When I try to SSH to imperial.modeemi.fi:22 it looks like a shell login. It asks for a username.
#13
Then would it be related to the missing libssl32.dll, libeay32.dll and openssl.exe files? I wasn't able to find all of them on the openssl site.

The website for the mud is http://imperialmud.org/, but one does not need to connect via SSH in order to access the MUD:

I seem unable to connect to Telnet from a certain workoffice, but there is an SSH option for implementors (like myself) that I can access with PuTTY. I just miss my incredibly awesome Mushclient features...
Australia Forum Administrator #14
I downloaded and ran this:

https://www.stunnel.org/downloads/stunnel-4.54-installer.exe

I didn't have any missing files.

Australia Forum Administrator #15
If you SSH from the office, how do you get past the login prompt? The stunnel is designed so that you connect and then answer the usual prompts.
#16
I have a login that should take me through that prompt once it shows up (I get it when I connect with PuTTY). It just says "login as:" right?

I meant missing files from the "OpenSSL DLLs" you referenced in your instructions.
#17
As near as I can tell, I'm doing everything right after meticulously following http://www.gammon.com.au/mushclient/stunnel.htm

There were a few changes here and there, so I'm not sure if this makes the difference. I had to go to the openssl website and download the version of the file mentioned, which did not contain all the components listed (libssl32.dll, libeay32.dll and openssl.exe), but I figured I'd try anyway.

Launching stunnel after doing all the configuration gave me the following result in the log:

2012.10.19 09:28:09 LOG5[5624:4220]: Reading configuration from file stunnel.conf
2012.10.19 09:28:09 LOG5[5624:4220]: FIPS mode is enabled
2012.10.19 09:28:09 LOG5[5624:4220]: Configuration successful

That looked about as good as I could hope, but MushClient seems unable to connect to 'localhost' on port '5555' as I designated (again following the isntructions blindly):

Unable to connect to "MyMUDStunnel", code = 10061 (Connection refused)

Error occurred during phase: Connecting to world: 127.0.0.1, port 5555

For assistance with connection problems see:
http://www.gammon.com.au/forum/?id=8369

Any guess where my disconnect may lie?
#18
Let me clarify. Step 3 of your instructions reads as follows:

•Stunnel requires the OpenSSL DLLs to work. You can currently find them at http://www.stunnel.org/download/stunnel/win32/openssl-0.9.6l/. Download the file openssl.zip. (That is a lower-case "L" at the end of the URL, not the number "1").
•Unzip the files in it (libssl32.dll, libeay32.dll and openssl.exe) into your c:\stunnel directory.
•If you can't find those files, or want more information, visit the OpenSSL web site.

The first link doesn't go to that page anymore. So going to the OpenSSL website and navigating to their http://www.openssl.org/source/ page, the version (9.6l) can be found and downloaded. Opening it up, though, the libssl32.dll, libeay32.dll and openssl.exe files are not present.
#19
As near as I can tell, I'm doing everything right after meticulously following http://www.gammon.com.au/mushclient/stunnel.htm

There were a few changes here and there, so I'm not sure if this makes the difference. I had to go to the openssl website and download the version of the file mentioned, which did not contain all the components listed (libssl32.dll, libeay32.dll and openssl.exe), but I figured I'd try anyway.

Launching stunnel after doing all the configuration gave me the following result in the log:

2012.10.19 09:28:09 LOG5[5624:4220]: Reading configuration from file stunnel.conf
2012.10.19 09:28:09 LOG5[5624:4220]: FIPS mode is enabled
2012.10.19 09:28:09 LOG5[5624:4220]: Configuration successful

That looked about as good as I could hope, but MushClient seems unable to connect to 'localhost' on port '5555' as I designated (again following the isntructions blindly):

Unable to connect to "MyMUDStunnel", code = 10061 (Connection refused)

Error occurred during phase: Connecting to world: 127.0.0.1, port 5555

For assistance with connection problems see:
http://www.gammon.com.au/forum/?id=8369

Any guess where my disconnect may lie?
Australia Forum Administrator #20
Those instructions are quite old.

I repeat, that all I did was run the installer here:

https://www.stunnel.org/downloads/stunnel-4.54-installer.exe


No files needed to be added.

I added your MUD to the stunnel.conf file.

I started stunnel.exe.


I connected using MUSHclient to localhost:5555

I see this in MUSHclient:


--- Connected on Tuesday, October 23, 2012, 7:44 AM ---
--- Disconnected on Tuesday, October 23, 2012, 7:44 AM ---
--- Connected for 0 days, 0 hours, 0 minutes, 1 second. ---

--- Received 4 lines, sent 0 lines.
--- Output buffer has 26/5000 lines in it (0.5% full).
--- Matched 0 triggers, 0 aliases, and 0 timers fired.
The "Imperial" server has closed the connection



I see this in the stunnel log file:


2012.10.23 07:44:54 LOG5[1052:2656]: Service [Imperial] accepted connection from 127.0.0.1:1783
2012.10.23 07:44:55 LOG5[1052:2656]: connect_blocking: connected 130.230.72.163:22
2012.10.23 07:44:55 LOG5[1052:2656]: Service [Imperial] connected remote server from 10.0.0.120:1784
2012.10.23 07:44:55 LOG3[1052:2656]: SSL_connect: 1408F10B: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
2012.10.23 07:44:55 LOG5[1052:2656]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket


I'm not sure about the "wrong version number" message.