Professional Documents
Culture Documents
Access Your Terminal From Your Browser - Butterfly
Access Your Terminal From Your Browser - Butterfly
Browsers - BUTTERFLY
Butterfly - A tool for accessing your terminal locally or remotely, from your web browser.
If you have a LAN with a number of machines running GNU / Linux. You may need to access a
remote terminal to perform various tasks. For this, the tools are numerous, starting with
alternatives such as Shellinabox, FireSSH or Secure Shell.
But Butterfly is another utility written in Python, which aims to provide users with an easy way
to access a local or remote shell, from any web browser and without any third-party plugins.
You will be easily way to access to your machine, and you will be able to take advantage of some
additional options, allowing you for example to use keyboard shortcuts.
Features Of Butterfly:
Native browser scroll and search
Theming in css / sass (20 preset themes) endless possibilities!
HTML in your terminal! cat images and use <table>
Multiple sessions support (à la screen -x) to simultaneously access a terminal from
several places on the planet!
Secure authentication with X509 certificates!
16,777,216 colors support!
Keyboard text selection!
Desktop notifications on terminal output!
Geolocation from browser!
May work on firefox too!
Installation Of Butterfly:
Once you have installed Butterfly on your machine, Now you can check the “Butterfly”
Information.
In this example I suppose you run the server as root, you want to access it as user “ashu” on a
local network and your ip address on this network is 172.16.10.7:
Writing /etc/butterfly/ssl/ashu.p12
[root@www ~]#
Note- If you run as root the certificates will be placed in /etc/buttefly/ssl/, as user in
~/.butterfly/ssl.
[root@www ~]#
Now certificate has been generated, you will have to configure your browser to accept your self-
signed certificate and the PKCS#12 file (which contains a private key for your user to log in).
Copy “butterfly_ca.crt” and “ashu.p12” to your remote system. where you want to access..
Under Firefox-
First go to Edit > Preferences > Advanced > View Certificates > Authorities > Import… and
specify the “butterfly_ca.crt” file.
Second go to Edit > Preferences > Advanced > View Certificates > Your Certificates> Import…
and specify the “ashu.p12” file.
butterfly.socket
Loaded: loaded (/etc/systemd/system/butterfly.socket; enabled; vendor preset:
disabled)
Active: active (listening) since Mon 2017-08-21 20:59:54 IST; 5s ago
Listen: [::]:57575 (Stream)
[root@www system]#
[root@www ~]# vim /etc/butterfly/butterfly.conf
Check Log-
Aug 21 21:34:36 www butterfly.server.py: socket.error: [Errno 98] Address already in use
Aug 21 21:34:36 www systemd: butterfly.service: main process exited, code=exited,
status=1/FAILURE
Aug 21 21:34:36 www systemd: Unit butterfly.service entered failed state.
Aug 21 21:34:36 www systemd: butterfly.service failed.
Aug 21 21:34:36 www systemd: start request repeated too quickly for butterfly.service
Aug 21 21:34:36 www systemd: Failed to start Butterfly Terminal Server.
Aug 21 21:34:36 www systemd: Unit butterfly.socket entered failed state.
Aug 21 21:34:36 www systemd: butterfly.service failed.
Aug 21 21:37:37 www systemd: Listening on butterfly.socket.
Aug 21 21:37:37 www systemd: Starting butterfly.socket.
Aug 21 21:38:09 www systemd: Started Butterfly Terminal Server.
Aug 21 21:38:09 www systemd: Starting Butterfly Terminal Server...
Aug 21 21:38:09 www butterfly.server.py: [W 170821 21:38:09 butterfly.server:347]
Butterfly is ready, open your browser to: https://172.16.10.7:57555/
Aug 21 21:38:29 www butterfly.server.py: [W 170821 21:38:29 iostream:1327] SSL Error
on 5 ('172.16.10.2', 54291): [SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad
certificate (_ssl.c:579)
-Ashutosh
Reference-
https://github.com/paradoxxxzero/butterfly