Issue
I am working on a Django app with following features.
online terminal to all users on my local network
The terminal frame should open at the bottom view, as soon as they are logged in.
There's a code editor in the top frame.
Their exists a linux account on the server with the same credentials that they use to login.
What I want:
- spawn a terminal instance
- ssh's to their remote account
- change directory to their home directory as directed by ssh-config file
- persist the terminal connection until they logout.
Bear in mind, this is all local, so accounts are all localplace, accessible.
I have created the top editor view, for now and it looks like this
The terminal picture shown below is from CodingGround
How do I add this sort of terminal here? How do sites like StudyTerminal do it? How can I implement this?
I have looked at implementations of shellInaBox and GateOne but they occupy full screen space and are their own server. I don't want another server just to provide a terminal. Can anybody help me sort this out?
Probably like a Jquery / AJAX terminal interface that takes the following parameters:
new terminal{
ssh_location : 10.10.56.24,
port: 12001,
username: username,
password: ######,
window_height: 100px;
window_width: 200px;
resizable:none
}
What's very important is that the terminal session should not occupy the full screen. Heavy functionalities such as multi user sessions, security may or not be necessary.
Solution
This is real necromancy, but I'm searching and answering all questions about Web Terminals.
You have two major options:
The first will allow creating a real Linux terminal you can connect it to a real Unix TTY. With xterm.js you can create real SSH where you can even run an editor like vi.
Here is an article that shows how to create a terminal with xterm.js: How to create web-based terminals
The second option will allow you to create a Web Terminal where you can do your stuff in JavaScript. if you want to use Django and AJAX, you can also do that.
And here is an article on how to use jQuery Terminal: How to create interactive terminal like website with JavaScript?
Answered By - jcubic Answer Checked By - Terry (WPSolving Volunteer)