huashengdun / webssh

:seedling: Web based ssh client
https://webssh.huashengdun.org/
MIT License
4.46k stars 1.25k forks source link

How to manage multiple machines through webssh? #22

Open ping035627 opened 6 years ago

ping035627 commented 6 years ago

I want to access all the machines in the LAN through webssh, how to manage multiple machines through webssh? Thanks.

ping035627 commented 6 years ago

@huashengdun

huashengdun commented 6 years ago

Hi ping035627, you can open multiple tabs on your browser, one tab for one session. Or multiple windows, one window for one session.

ping035627 commented 6 years ago

@huashengdun , All the machines are in a local area network, only one machine can communicate with the outside network. I want to provide the function of Web terminal through this machine. Can this function be implemented through webssh?

huashengdun commented 6 years ago

You can install this app on the machine that can communicate with the outside network. And enable ssh service on other machines in this local network. Then you can use this app to connect to these machines with their local ip addresses.

ping035627 commented 6 years ago

@huashengdun, So webssh can connect more than one machine at the same time? The webssh app install on the machine that can communicate with the outside network as a agent? And how to configure which machine to connect in the app? Thanks very much!

huashengdun commented 6 years ago

Yes, it can connect to multiple machines at the same time. But it can't be configured with any information which is needed to connect to your servers. You just input these information into the form on the web page.

huashengdun commented 6 years ago

Actually you can configure your ssh information in your JavaScript code. Use content scripts https://developer.chrome.com/extensions/content_scripts to execute the code every time when the page loaded.

You can define many objects like that,

var machine1 = {
  hostname: 'hostname',
  port: 'port',
  username: 'username',
  password: 'password'
};

var machine2 = {
  hostname: 'hostname',
  port: 'port',
  username: 'username',
  password: 'password'
};

Then you connect to them by running

wssh.connect(machine1);
wssh.connect(machine2);
yanxiaowuchris commented 5 years ago

var machine1 = { hostname: 'hostname', port: 'port', username: 'username', password: 'password' }; wssh.connect(machine1); 这种方式,js运行在哪里?

huashengdun commented 5 years ago

@yanxiaowuchris 在浏览器的控制台(console)运行。 Ctrl + Shift + I, 然后点击console进入控制台。

yanxiaowuchris commented 5 years ago

非常感谢,我已经解决问题啦

aryanguenthner commented 5 years ago

Feature Request - X Forwarding

huashengdun commented 5 years ago

@aryanguenthner Check option xheaders, X-Forwarded-For and X-Forwarded-Port supported.