Pavan Kishore
Pavan Kishore

Reputation: 91

How to open terminal from browser in mac?

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?

Upvotes: 1

Views: 7703

Answers (2)

FriendToGeoff
FriendToGeoff

Reputation: 31

Coming late to this thread.

Safari and OSX support:

ssh://[email protected]

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.

Upvotes: 2

recrsn
recrsn

Reputation: 480

For security reasons you cannot open arbitrary applications from a webpage.

So, you are left with few options:

  1. 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

  2. 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.

  3. Use websocket based VNC/SSH such as https://github.com/aluzzardi/wssh

Upvotes: 4

Related Questions