ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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:
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)
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).
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.