Browse Source

Overcome restrictive environments #4

Bob Mottram 11 years ago
parent
commit
a3bc872964
1 changed files with 65 additions and 6 deletions
  1. 65
    6
      beaglebone.txt

+ 65
- 6
beaglebone.txt View File

@@ -3196,6 +3196,71 @@ make install
3196 3196
 pybitmessage
3197 3197
 #+END_SRC
3198 3198
 
3199
+** Overcome restrictive environments
3200
+
3201
+In some environments, such as behind corporate firewalls or under regimes hostile towards the idea of open access to knowledge and information you may find that you're not able to use tools such as /ssh/ to get access to the BBB.  In the worst case all ports other than 80 and 443 may be blocked.
3202
+
3203
+In that scenario you can use a tool called [[http://code.google.com/p/shellinabox/][shellinabox]] to log into your BBB via your web site rather than via a terminal.  This means that you can administrate your system from any device which has a web browser and keyboard.
3204
+
3205
+#+BEGIN_SRC: bash
3206
+apt-get install shellinabox libapache2-mod-proxy-html
3207
+#+END_SRC
3208
+
3209
+Update your Apache configuration.
3210
+
3211
+#+BEGIN_SRC: bash
3212
+export HOSTNAME=mydomainname.com
3213
+emacs /etc/apache2/sites-available/$HOSTNAME
3214
+#+END_SRC
3215
+
3216
+Within the section which begins with *<VirtualHost *:443>* add the following, replacing /mydomainname.com/ with your domain name and /myusername/ with your username.
3217
+
3218
+#+BEGIN_SRC: bash
3219
+  <Location /shell>
3220
+    ProxyPass http://localhost:4200/
3221
+    Order allow,deny
3222
+    Allow from all
3223
+
3224
+    AuthName "Authentication for shellinabox"
3225
+    AuthUserFile /home/mydomainname.com/public_html/.htpasswd
3226
+    AuthGroupFile /home/mydomainname.com/public_html/.htgroup
3227
+    AuthType Basic
3228
+    Require group shellinabox
3229
+    Require user myusername
3230
+  </Location>
3231
+#+END_SRC
3232
+
3233
+Save and exit, then create a login password.  It's recommended that the password be a long random string and that you then access it using a password manager such as KeepassX.
3234
+
3235
+#+BEGIN_SRC: bash
3236
+mkdir /home/$HOSTNAME
3237
+mkdir /home/$HOSTNAME/public_html
3238
+htpasswd -c /home/$HOSTNAME/public_html/.htpasswd myusername
3239
+#+END_SRC
3240
+
3241
+Create a user group.
3242
+
3243
+#+BEGIN_SRC: bash
3244
+emacs /home/$HOSTNAME/public_html/.htgroup
3245
+#+END_SRC
3246
+
3247
+Add the following:
3248
+
3249
+#+BEGIN_SRC: bash
3250
+shellinabox: myusername
3251
+#+END_SRC
3252
+
3253
+Save and exit, then restart Apache.
3254
+
3255
+#+BEGIN_SRC: bash
3256
+a2enmod proxy_http
3257
+service apache2 restart
3258
+#+END_SRC
3259
+
3260
+Now with a web browser navigate to https://mydomainname.com/shell and log in.
3261
+
3262
+If you're in a very locked down environment where access to web sites is severely restricted then as a last resort you may be able to use a command line browser, such as [[https://en.wikipedia.org/wiki/Lynx_%28web_browser%29][lynx]] from within /shellinabox/.
3263
+
3199 3264
 ** Install Tripwire
3200 3265
 
3201 3266
 #+BEGIN_VERSE
@@ -3261,12 +3326,6 @@ The following ports on your internet router/firewall should be forwarded to the
3261 3326
 * Hints and Tips
3262 3327
 ** Messaging security
3263 3328
 If you're connected to other friends via Friendica then the preferred way to send private messages is via Friendica's built-in messaging system.  This is a lot more convenient than using GPG with ordinary email and yet still provides a similar level of protection from unwarranted interception.
3264
-** Restrictive/hostile user environments
3265
-If you are typically operating within a restrictive of hostile environment where using ssh is not an option because everything other than web ports are blocked then you may wish to try installing oterm:
3266
-
3267
-http://www.coralbits.com/oterm/
3268
-
3269
-https://github.com/davidmoreno/onion
3270 3329
 ** Moving Domains
3271 3330
 If you're moving servers and using a different domain name or path then you can search and replace URLs within files in the following way:
3272 3331