I want to open a terminal window from browser. The web application displays an ssh command and ssh password for logging into some server. I want this command to be pasted into a terminal window with a button click in the webpage. Anyone has any idea about how we can do this?
-
I haven't tried this, but maybe you could use the 'ssh://' protocol? Or just explain how to open a Terminal ^_^ – grooveplex Jan 19 '17 at 10:43
2 Answers
For security reasons you cannot open arbitrary applications from a webpage.
So, you are left with few options:
Ask them to open a terminal window, copy the text by a button click to their clipboard and ask them to paste it at required place. See here https://stackoverflow.com/a/30810322/2328165
If users are novice and all machines are under your control (newbies at training institute, where being proficient in opening a terminal is not required), you can write a custom protocol handler with a command and a validating parameter for something like
term:uri-encoded-command&secret=some-hash
and install them. Be careful though, might be a risk.Use websocket based VNC/SSH such as https://github.com/aluzzardi/wssh
Coming late to this thread.
Safari and OSX support:
ssh://username@10.0.0.1
style URIs so that you can create links that launch terminal. These are simple and clean.
At the moment this seems to work for IPv4 addresses, names that resolve to IPv4 or IPv6 addresses, but there doesn't seem to be support for naked IPv6 addresses. If anyone knows the magic runes for the IPv6 It'd be great to know.

- 31
- 3