Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telnet connection #87

Closed
qwerty123dert opened this issue Feb 8, 2012 · 20 comments
Closed

Telnet connection #87

qwerty123dert opened this issue Feb 8, 2012 · 20 comments

Comments

@qwerty123dert
Copy link

Hi,

you can implement a telnet connection with the current ssh, to login in network's system ?

thanks.

@liftoff
Copy link
Owner

liftoff commented Feb 9, 2012

I just pushed a commit that adds support for the telnet protocol to ssh_connect.py. I also added support for telnet:// URLs to the Bookmarks plugin. So you can bookmark them too.

I might add a couple other text-based protocols while I'm at it. Any recommendations?

@qwerty123dert
Copy link
Author

My need was only telnet.
So will you upload the recompiled ssh_connect.py and simply replace it in the directory? What is the procedure to do?

Thanks

@liftoff
Copy link
Owner

liftoff commented Feb 10, 2012

The proper procedure is to update your code with the latest from Github (or download the tarball) and then run "sudo python setup.py install" inside the GateOne directory. ssh_connect.py was only a small part of what I had to change to enable telnet support so you'll definitely need all the updates.

Also an FYI: The latest commit doesn't have that 'Protocol [ssh]' line anymore (it was unnecessary complexity) so if you want to use telnet you must use the telnet:// URL format (e.g. 'telnet://hostname').

@liftoff liftoff closed this as completed Feb 10, 2012
@qwerty123dert
Copy link
Author

Great! I'll try right away.
Thanks to the availability and kindness shown.

@qwerty123dert
Copy link
Author

Hi,

i have a problem with the shown prompt.
I noticed the following issues:
pressing the enter key the "switch1#" don't go down as they normally with a telnet session.
The space bar does not work.
The imput command are not shown (but if you press the enter key the command is accepted).

tanks for all.
regards.

@liftoff
Copy link
Owner

liftoff commented Feb 14, 2012

What browser are you using? Also, what do you mean "pressing the enter key the 'switch1#' don't go down"? I have no idea what you mean by 'switch1#'.

@liftoff
Copy link
Owner

liftoff commented Feb 14, 2012

I've created a session playback of myself using telnet to login to my local workstation... All the keyboard keys appear to work (in Chrome anyway). You can view it here:

http://www.box.com/s/isb20ef5lp443qs825yr

@qwerty123dert
Copy link
Author

Hi, tanks for the fast response.

My 'switch1#' is your "riskable@portarisk:~ $" and I mean, when I press the enter key, the prompt should not be a line down.
My browsers are chome and firefox (last version naturally), and I have the same problems with both said first.

I saw your video where everything works, but I do not feel that way.

tanks for all, very kind.
regards.

@liftoff
Copy link
Owner

liftoff commented Feb 22, 2012

I recently spent some time trying to reproduce this issue and I think I might have fixed it in the latest release... It might have been a bug in Terminal.resize(). It gets called at various points in the process of using Gate One (because setting the terminal size is a fickle thing) and when this happens the margins get reset. If what you were connecting to set the margins a certain way it is possible that was the cause of your problem.

Please pull the latest code and give it a try. If it still doesn't fix the issue then I'm going to need more information about what it is that you're connecting to and what, if any, special escape sequences it might be sending to Gate One (escape sequence bugs are a big pain because they can be difficult to reproduce).

Also, if you run Gate One like so: "./gateone.py --session_logging=True" ...and send me the resulting .golog file (it's a record of your session) I can take a look at it. It would immediately reveal if there's some escape sequence bug at play.

@qwerty123dert
Copy link
Author

hi

I tested but i have the same results....
I have logged the session but, where i can find the .golog file?

@liftoff
Copy link
Owner

liftoff commented Mar 2, 2012

Somehow I missed your message... The .golog files are stored in /opt/gateone/users//logs by default. If you haven't enabled authentication the [username] will be ANONYMOUS.

So just connect to Gate One, reproduce the issue, then send me the newest .golog from that directory. You can verify it's the correct one using the Log Viewer in Gate One or using the logviewer.py script like so:

./logviewer.py /opt/gateone/users/[username]/logs/[the file].golog

Once I get that .golog I'll be able to play back precisely what was output programmatically in the terminal emulator (terminal.py). I can step through it character by character to figure out where--if any--there's a bug. That's how I usually have to fix things like this because the documentation on VT-style terminals is a mess (not detailed enough, too detailed, or just plain wrong).

@qwerty123dert
Copy link
Author

Hi

in the directory /opt/gateone/ there is no the directory /users/logs.
And if i try di find *.golog in the system, there in no results.

P.S i have run the command "./gateone.py --session_logging=True"

@liftoff
Copy link
Owner

liftoff commented Mar 2, 2012

When you run Gate One it should automatically create the users directory. Here's what my log path looks like:

root@portarisk:/opt/gateone/users/ANONYMOUS/logs # ls
20120221090955102040.golog  20120221115733308370.golog  20120221161318089161.golog  20120223112855715470.golog  20120225145302309752.golog  20120225153219293089.golog  20120225153223879831.golog  20120228120527474463.golog

Can you copy & paste your server.conf into this ticket?

Also, I need to know your browser, OS version, and what OS you're running Gate One on. Once I have that information I can setup a test environment to replicate your situation.

You should also download my latest commit, blow away your /opt/gateone directory, and re-install. There might be something that didn't get installed properly as a result of your manual "setup_dir" workaround (which isn't necessary with the latest commit).

@liftoff
Copy link
Owner

liftoff commented Mar 2, 2012

I just noticed that my recent commit is broken... So don't grab it. LOL. I'll fix it later today.

@qwerty123dert
Copy link
Author

OK will wait

2012/3/2 Dan McDougall <
reply@reply.github.com

I just noticed that my recent commit is broken... So don't grab it. LOL.
I'll fix it later today.


Reply to this email directly or view it on GitHub:
#87 (comment)

@liftoff
Copy link
Owner

liftoff commented Mar 5, 2012

You can try it now... I just pushed Gate One 1.0 :)

@qwerty123dert
Copy link
Author

I just tried but at the command telnet://x.x.x.x i have this:

Got Exception trying to run openssh_connect: sequence item 4: expected string, int found
Traceback (most recent call last):
File "/opt/gateone/plugins/ssh/scripts/ssh_connect.py", line 758, in
telnet_connect(user, host, port)
File "/opt/gateone/plugins/ssh/scripts/ssh_connect.py", line 453, in telnet_connect
cmd=" ".join(args),
TypeError: sequence item 4: expected string, int found
Please open up a new issue at https://github.com/liftoff/GateOne/issues and paste the above information.

@Desmodue
Copy link

Desmodue commented Aug 8, 2012

Hi

Think I have found the issue for this error.
ssh_connect.py script.

Line 453 is trying to join the args, join only accepts strings. port is an integer (int ) as set on line 411.
On line 432 args is populated

args = [host, port]

So, change this line to:-

args = [host, str(port)]

It then works :)

Now I just need to get it to emulate a Wyse 50 .

@liftoff
Copy link
Owner

liftoff commented Aug 8, 2012

You're obviously using Gate One 1.0... That issue has long since been fixed in the github code. 1.1 will be out soon though which will include the fix. Just need to finish up a number of tutorials/examples I've been working on.

@Desmodue
Copy link

Desmodue commented Aug 8, 2012

Yep, found it in he repository after some digging, replaced my altered v1 ssh_connect.py script with the v1.1 ssh_connect.py script and it is all working :)

pauldorn pushed a commit to pauldorn/GateOne that referenced this issue Sep 22, 2015
…ONDER people were saying some things just don't look right. LOL!

auth.py:  Fixed all the authentication redirects so they works with the new url_prefix option.
gateone.py:  Fixed the login_url (Tornado setting) so it now uses the url_prefix option.
gateone.py:  Fixed the HTTPSRedirectHandler so it also takes the url_prefix into account.  I also changed its URL pattern regex to be ".*" (meaning, 'match anything') from just "/" (meaning, 'match *just* http://whatever/').  That way a user can hit your Gate One server's hostname/IP via HTTP in a browser with *any* URL and get magically redirected to HTTPS on the proper port.
gateone.py:  Removed that leftover print statement from the new ErrorHandler.
SSH Plugin:  Added support for telnet:// URLs to ssh_connect.py.  This should resolve liftoff#87
Bookmarks Plugin:  Added support for telnet:// URLs as well.
Bookmarks Plugin:  Added a new type of tag that gets automatically added to bookmarks:  URL type.  Essentially this will let you filter the bookmarks list based on the type of URL in the bookmark.  This was necessary in order to be able to easily differentiate between ssh:// and telnet:// URLs.
Bookmarks Plugin:  Added a new "Autotags" section to the tag cloud area where you can filter based on URL type (protocol) and the age of bookmarks (e.g. "<7 Days").
setup.py:  Made a minor change to ensure that when it is run that the combined_plugins.js gets automatically overwritten.
Playback Plugin:  Changed playback.js a bit in an attempt to save some memory but I believe what I'm experiencing is a bug in Chrome...  Everything stays nice and low (in terms of memory utilization) and then suddenly jumps a huge amount after switching tabs and then back again.  It needs more investigation.
Logging Plugin:  Added the ability to download logs in the self-contained recording format.
NOTE:  Something strange is going on with log titles and the new telnet protocol support in ssh_connect.py.  It'll be fixed soon.
pauldorn pushed a commit to pauldorn/GateOne that referenced this issue Sep 22, 2015
…sn't being properly converted to a string. This should fix the issue reported in liftoff#87

Playback Plugin:  Fixed a bug where you could get UnicodeDecodeErrors when exporting the current session recording.  This should fix the issue reported in liftoff#90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants