LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-03-2011, 06:31 PM   #1
Gideon1a
LQ Newbie
 
Registered: Jul 2011
Posts: 1

Rep: Reputation: Disabled
How to write a Putty screen in a browser


I want to aquire, or write it if I must, a browser app that will act as a PUTTY app.

For reasons too involved for this discussion, I need to avoid both Java and MicroSoft, and focus on generally available scripting languages used in browsers, like JavaScript, PHP, etc

I want the code to open a socket connecting to a server SSH (not going through the web server, but the client browser connection directly to a SSH server), and then append each line to the botton of the browser in a Courier New font. I will also need to place the cursor at certain positions in a 24 row, 80 column format.

1> Is this possible.

2> How would you do it ?

Thanks in advance
 
Old 07-03-2011, 08:47 PM   #2
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
So, you mean a web-based SSH client, without any kind of a server back-end? There are of course many solutions where the web interface uses a server as a relay (or gateway between SSH and XML over HTTPS), but I understand you are looking for a solution which does not involve such a relay server at all.

I don't think it is possible with just Javascript, because Javascript has no support for raw sockets (that you need to connect to a SSH server). HTML5 WebSocket API is unlikely to help either, because it requires a relay server.

While Flash could support raw socket connections, its security policies require the target machine to provide a 'socket policy file' (in case of raw socket connections, especially to ports under 1024). They vary a bit between versions, older Flash plugins being more relaxed. I checked both the socket support in open-source haXe which can be used to write Flash movies, and Adobe ActionScript 3 reference docs.

So, to answer your questions:
  1. No, it does not seem to be possible to write a SSH client, that works in a browser, does not use a proxy server connection, using only the most common browser features (Javascript, Flash, HTML5)
  2. I would use a trusted proxy server.
    See ajaxterm, anyterm, Shell In A Box, and WebShell.
    If you are unable to host a proxy server yourself, SerFISH seem to provide that as a free service (for short connections).

Hope this helps.
 
Old 07-05-2011, 12:58 PM   #3
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 490
Blog Entries: 4

Rep: Reputation: 238Reputation: 238Reputation: 238
Gideon1a, you mention php as a possibility, which is a server-based scripting tool. Do you have the ability to write a server script, or not?
 
Old 07-05-2011, 01:46 PM   #4
orgcandman
Member
 
Registered: May 2002
Location: new hampshire
Distribution: Fedora, RHEL
Posts: 600

Rep: Reputation: 110Reputation: 110
there is a php ssh package which does what you're looking to do.

@Nominal,
Do you really mean raw sockets? Or do you just mean a socket interface? ssh operates over tcp port 22 - anything that will let you open a tcp socket and can perform the maths related operations should be able to implement an ssh client.
 
Old 07-05-2011, 02:00 PM   #5
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Hope this helps.

http://gscripts.net/free-php-scripts...r/details.html

This is a PHP script that does what you are asking. You will have to look at the details yourself to see that it meets all of your requirments.
 
Old 07-07-2011, 12:59 AM   #6
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
Quote:
Originally Posted by orgcandman View Post
@Nominal,
Do you really mean raw sockets?
I mean a plain socket interface, without extra handshaking or conversion to XML.

Javascript and Flash documentation refer to 'sockets', when they actually refer to cooked sockets, which have extra data, special handshakes, or convert the communications to XML, without any possibility of actually controlling the data flowing at the socket level. Javascript and Flash sockets do in certain circumstances look like normal sockets to application developers (with the server end running under a specific type of HTTP server or server module), but when connecting to normal services, these 'sockets' are something totally different.

To avoid the confusion with the documentation, I used the term 'raw socket'. In general, 'raw socket' usually refers to a socket using the lower-level communications layer, usually IP (as opposed to TCP/IP or UDP/IP), where the socket user is responsible for constructing the actual packets transmitted by the lower layer, including the headers that are part of the protocol, and are automatically handled by the operating system for normal sockets. Actual 'raw sockets' require extra privileges to use, and are not something normal users or browsers should be able to do at all, so I thought the risk of confusion neglible.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Putty through Browser??? linuxshadow Linux - Server 1 06-10-2008 07:38 AM
Black Screen PuTTY and SSH on Slackware 10 cummic Slackware 52 12-14-2004 12:21 PM
Putty telnet question (Login Screen goes away) wardialer Linux - Newbie 1 10-16-2004 03:51 PM
Write a MIB browser ?? juby Programming 0 12-22-2003 06:17 AM
For Squid (proxy server) gurus: FTP from browser with read-write-modify permission Zingaro2002 Linux - Software 5 11-24-2003 04:56 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration