{"id":9499,"date":"2019-02-10T07:27:23","date_gmt":"2019-02-10T07:27:23","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=9499"},"modified":"2019-02-10T07:27:23","modified_gmt":"2019-02-10T07:27:23","slug":"shell-in-a-box-a-web-based-ssh-terminal-to-access-remote-linux-servers","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/02\/10\/shell-in-a-box-a-web-based-ssh-terminal-to-access-remote-linux-servers\/","title":{"rendered":"Shell In A Box \u2013 A Web-Based SSH Terminal to Access Remote Linux Servers"},"content":{"rendered":"<p><strong>Shell In A Box<\/strong>\u00a0(pronounced as\u00a0<strong>shellinabox<\/strong>) is a web based terminal emulator created by\u00a0<strong>Markus Gutschke<\/strong>. It has built-in web server that runs as a web-based\u00a0<strong>SSH client<\/strong>\u00a0on a specified\u00a0<strong>port<\/strong>\u00a0and prompt you a web terminal emulator to access and control your\u00a0<strong>Linux Server SSH Shell<\/strong>\u00a0remotely using any\u00a0<strong>AJAX<\/strong>\/<strong>JavaScript<\/strong>\u00a0and\u00a0<strong>CSS<\/strong>enabled browsers without the need of any additional browser plugins such as\u00a0<a href=\"https:\/\/www.tecmint.com\/firessh-a-web-based-ssh-client\/\" target=\"_blank\" rel=\"noopener\">FireSSH<\/a>.<\/p>\n<p>In this tutorial, I describe how to install\u00a0<strong>Shellinabox<\/strong>\u00a0and access remote\u00a0<strong>SSH terminal<\/strong>\u00a0using a modern web browser on any machine.\u00a0<strong>Web-based SSH<\/strong>\u00a0is very useful when you are protected with\u00a0<strong>firewall<\/strong>\u00a0and only\u00a0<strong>HTTP<\/strong>(<strong>s<\/strong>) traffic can get through.<\/p>\n<h3>Installing Shellinabox on Linux<\/h3>\n<p>By default,\u00a0<strong>Shellinabox<\/strong>\u00a0tool is included on many\u00a0<strong>Linux<\/strong>\u00a0distributions through default repositories, including\u00a0<strong>Debian<\/strong>,\u00a0<strong>Ubuntu<\/strong>\u00a0and\u00a0<strong>Linux Mint<\/strong>.<\/p>\n<p>Make sure that your repository enabled and available to install\u00a0<strong>Shellinabox<\/strong>\u00a0from the that repository. To check, do a search for\u00a0<strong>Shellinabox<\/strong>\u00a0with the \u201c<strong>apt-cache<\/strong>\u201d command and then install it using \u201c<strong>apt-get<\/strong>\u201d command. `<\/p>\n<h5>On Debian, Ubuntu and Linux Mint<\/h5>\n<pre>$ sudo apt-cache search shellinabox\r\n$ sudo apt-get install openssl shellinabox<\/pre>\n<h5>On RHEL, CentOS and Fedora<\/h5>\n<p>On\u00a0<strong>Red Hat<\/strong>\u00a0based distributions, you need to first have\u00a0<a href=\"https:\/\/www.tecmint.com\/how-to-enable-epel-repository-for-rhel-centos-6-5\/\" target=\"_blank\" rel=\"noopener\">enable EPEL repository<\/a>\u00a0and then install it using the following \u201c<strong>yum<\/strong>\u201d command. (<strong>Fedora<\/strong>\u00a0users don\u2019t need to enable\u00a0<strong>EPEL<\/strong>, it\u2019s already a part of\u00a0<strong>Fedora<\/strong>\u00a0project).<\/p>\n<pre># yum install openssl shellinabox<\/pre>\n<h3>Configuring Shellinabox<\/h3>\n<p>By default,\u00a0<strong>shellinaboxd<\/strong>\u00a0listens on\u00a0<strong>TCP<\/strong>\u00a0port\u00a0<strong>4200<\/strong>\u00a0on\u00a0<strong>localhost<\/strong>. For security reason, I change this default port to a random (i.e.\u00a0<strong>6175<\/strong>) to make it difficult for anyone to reach your\u00a0<strong>SSH<\/strong>\u00a0box. Also, during installation a new self-signed\u00a0<strong>SSL<\/strong>\u00a0certificate automatically created under \u201c<strong>\/var\/lib\/shellinabox<\/strong>\u201d to use\u00a0<strong>HTTPS<\/strong>\u00a0protocol.<\/p>\n<h5>On Debian, Ubuntu and Linux Mint<\/h5>\n<pre>$ sudo vi \/etc\/default\/shellinabox<\/pre>\n<pre># TCP port that shellinboxd's webserver listens on\r\nSHELLINABOX_PORT=6175\r\n\r\n# specify the IP address of a destination SSH server\r\nSHELLINABOX_ARGS=\"--o-beep -s \/:SSH:172.16.25.125\"\r\n\r\n# if you want to restrict access to shellinaboxd from localhost only\r\nSHELLINABOX_ARGS=\"--o-beep -s \/:SSH:172.16.25.125 --localhost-only\"<\/pre>\n<h5>On RHEL, CentOS and Fedora<\/h5>\n<pre># vi \/etc\/sysconfig\/shellinaboxd<\/pre>\n<pre># TCP port that shellinboxd's webserver listens on\r\nPORT=6175\r\n\r\n# specify the IP address of a destination SSH server\r\nOPTS=\"-s \/:SSH:172.16.25.125\"\r\n\r\n# if you want to restrict access to shellinaboxd from localhost only\r\nOPTS=\"-s \/:SSH:172.16.25.125 --localhost-only\"<\/pre>\n<h3>Starting Shellinabox<\/h3>\n<p>Once you\u2019ve done with the configuration, you can start the service by issuing following command.<\/p>\n<h5>On Debian, Ubuntu and Linux Mint<\/h5>\n<pre>$ sudo service shellinaboxd start<\/pre>\n<h5>On RHEL and CentOS<\/h5>\n<pre># service shellinaboxd start<\/pre>\n<h5>On Fedora<\/h5>\n<pre># systemctl enable shellinaboxd.service\r\n# systemctl start shellinaboxd.service<\/pre>\n<h3>Verify Shellinabox<\/h3>\n<p>Now let\u2019s verify whether\u00a0<strong>Shellinabox<\/strong>\u00a0is running on port\u00a0<strong>6175<\/strong>\u00a0using \u201c<strong>netstat<\/strong>\u201d command.<\/p>\n<pre>$ sudo netstat -nap | grep shellinabox\r\nor\r\n# netstat -nap | grep shellinabox<\/pre>\n<pre>tcp        0      0 0.0.0.0:6175            0.0.0.0:*               LISTEN      12274\/shellinaboxd<\/pre>\n<p>Now open up your web browser, and navigate to\u00a0<strong>https:\/\/Your-IP-Adress:6175<\/strong>. You should be able to see a web-based\u00a0<strong>SSH terminal<\/strong>. Login using your\u00a0<strong>username<\/strong>\u00a0and\u00a0<strong>password<\/strong>\u00a0and you should be presented with your shell prompt.<\/p>\n<div id=\"attachment_4313\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/shell-in-a-box-a-web-based-ssh-terminal-to-access-remote-linux-servers\/shellinabox-1\/\" rel=\"attachment wp-att-4313\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-4313\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/10\/Shellinabox-1-620x440.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/10\/Shellinabox-1-620x440.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/10\/Shellinabox-1.png 880w\" alt=\"Install Shellinabox in Linux\" width=\"620\" height=\"440\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Shellinabox SSH Login<\/p>\n<\/div>\n<div id=\"attachment_4315\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/shell-in-a-box-a-web-based-ssh-terminal-to-access-remote-linux-servers\/shellinabox-2\/\" rel=\"attachment wp-att-4315\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-4315\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/10\/Shellinabox-2-620x440.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/10\/Shellinabox-2-620x440.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/10\/Shellinabox-2.png 881w\" alt=\"Shellinabox SSH Shell\" width=\"620\" height=\"440\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Shellinabox SSH Shell<\/p>\n<\/div>\n<div id=\"attachment_4316\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/shell-in-a-box-a-web-based-ssh-terminal-to-access-remote-linux-servers\/shellinabox-3\/\" rel=\"attachment wp-att-4316\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-4316\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/10\/Shellinabox-3-620x440.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/10\/Shellinabox-3-620x440.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/10\/Shellinabox-3.png 882w\" alt=\"Shellinabox SSH Logout\" width=\"620\" height=\"440\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Shellinabox SSH Logout<\/p>\n<\/div>\n<p>You can\u00a0<strong>right-click<\/strong>\u00a0to use several features and actions, including changing the look and feel of your shell.<\/p>\n<div id=\"attachment_4317\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/shell-in-a-box-a-web-based-ssh-terminal-to-access-remote-linux-servers\/shellinabox-4\/\" rel=\"attachment wp-att-4317\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-4317\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/10\/Shellinabox-4-620x438.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/10\/Shellinabox-4-620x438.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/10\/Shellinabox-4.png 883w\" alt=\"Shellinabox More Options\" width=\"620\" height=\"438\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Shellinabox More Options<\/p>\n<\/div>\n<p>Make sure you secure you\u00a0<strong>shellinabox<\/strong>\u00a0on\u00a0<strong>firewall<\/strong>\u00a0and open\u00a0<strong>6175<\/strong>\u00a0port for specific\u00a0<strong>IP Address<\/strong>\u00a0to access your Linux shell remotely.<\/p>\n<h3>Reference Links<\/h3>\n<p><a href=\"https:\/\/code.google.com\/p\/shellinabox\/\" target=\"_blank\" rel=\"nofollow noopener\">Shellinabox Homepage<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Shell In A Box\u00a0(pronounced as\u00a0shellinabox) is a web based terminal emulator created by\u00a0Markus Gutschke. It has built-in web server that runs as a web-based\u00a0SSH client\u00a0on a specified\u00a0port\u00a0and prompt you a web terminal emulator to access and control your\u00a0Linux Server SSH Shell\u00a0remotely using any\u00a0AJAX\/JavaScript\u00a0and\u00a0CSSenabled browsers without the need of any additional browser plugins such as\u00a0FireSSH. In &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/02\/10\/shell-in-a-box-a-web-based-ssh-terminal-to-access-remote-linux-servers\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Shell In A Box \u2013 A Web-Based SSH Terminal to Access Remote Linux Servers&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9499","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/9499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=9499"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/9499\/revisions"}],"predecessor-version":[{"id":9500,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/9499\/revisions\/9500"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=9499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=9499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=9499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}