Difference between revisions of "Graphical Shell with WebShell"

From WebOS Internals
Jump to navigation Jump to search
(New page: Most people are reporting that [ajaxphpterm] works better than this method. You might want to try that one first ... This article will allow you to use your web browser on your Pre f...)
 
Line 1: Line 1:
Most people are reporting that [[[ajaxphpterm]]] works better than this method.  You might want to try that one first ...
+
Most people are reporting that [[ajaxphpterm]] works better than this method.  You might want to try that one first ...
  
 
This article will allow you to use your web browser on your Pre for a terminal. You should have already rooted your Pre and installed an SSH server, enabled sudo and set up the optware repositories.
 
This article will allow you to use your web browser on your Pre for a terminal. You should have already rooted your Pre and installed an SSH server, enabled sudo and set up the optware repositories.
Line 5: Line 5:
 
1. SSH into your Pre.
 
1. SSH into your Pre.
 
2. Download Webshell:
 
2. Download Webshell:
[[code]]
+
<pre><nowiki>
 
wget http://web-shell.googlecode.com/files/WebShell-0.9.6.zip
 
wget http://web-shell.googlecode.com/files/WebShell-0.9.6.zip
[[/code]]
+
</nowiki></pre>
 
3. Install Python:
 
3. Install Python:
[[code]]
+
<pre><nowiki>
 
sudo /opt/bin/ipkg-opt install python
 
sudo /opt/bin/ipkg-opt install python
[[/code]]
+
</nowiki></pre>
 
4. Extract the contents of WebShell-0.9.6.zip:
 
4. Extract the contents of WebShell-0.9.6.zip:
[[code]]
+
<pre><nowiki>
 
unzip WebShell-0.9.6.zip
 
unzip WebShell-0.9.6.zip
[[/code]]
+
</nowiki></pre>
 
5. Generate a server certificate:
 
5. Generate a server certificate:
[[code]]
+
<pre><nowiki>
 
cd WebShell-0.9.6
 
cd WebShell-0.9.6
 
sh ./make_certificate.sh
 
sh ./make_certificate.sh
[[/code]]
+
</nowiki></pre>
 
6. Move WebShell to /opt/share/webshell:
 
6. Move WebShell to /opt/share/webshell:
[[code]]
+
<pre><nowiki>
 
cd ..
 
cd ..
 
sudo mv WebShell-0.9.6/ /opt/share/webshell
 
sudo mv WebShell-0.9.6/ /opt/share/webshell
[[/code]]
+
</nowiki></pre>
 
7. Create an upstart script "/etc/event.d/webos-webshell" with the following contents:
 
7. Create an upstart script "/etc/event.d/webos-webshell" with the following contents:
[[code]]
+
<pre><nowiki>
 
start on stopped finish
 
start on stopped finish
 
stop on runlevel [!2]
 
stop on runlevel [!2]
Line 36: Line 36:
  
 
exec /opt/bin/python /opt/share/webshell/webshell.py -c "/opt/bin/ssh -p 222 -l $USER localhost" --ssl-disable
 
exec /opt/bin/python /opt/share/webshell/webshell.py -c "/opt/bin/ssh -p 222 -l $USER localhost" --ssl-disable
[[/code]]
+
</nowiki></pre>
 
where $USER is replaced by your user name.
 
where $USER is replaced by your user name.
  
Line 42: Line 42:
  
 
9. Open up your web browser and go to
 
9. Open up your web browser and go to
[[code]]
+
<pre><nowiki>
 
http://127.0.0.1:8022
 
http://127.0.0.1:8022
[[/code]]
+
</nowiki></pre>
 
10. Type in your password and you now have a shell. You can run any commands you want now directly on your phone.
 
10. Type in your password and you now have a shell. You can run any commands you want now directly on your phone.
  
**Note** If it looks like you are seeing a bunch of text flash at the top of the screen, rotate your phone into Landscape mode, hit the enter key a bunch of times.  You will either be able to see the error and can fix it through your version of SSH or you will get a disconnection message.  If you do get a disconnected message, hit Refresh and try to login.  It should start working then.  
+
'''Note''' If it looks like you are seeing a bunch of text flash at the top of the screen, rotate your phone into Landscape mode, hit the enter key a bunch of times.  You will either be able to see the error and can fix it through your version of SSH or you will get a disconnection message.  If you do get a disconnected message, hit Refresh and try to login.  It should start working then.  
  
**Note** Eventually there will be a way to disable the auto-text functions (automatic caps especially).
+
'''Note''' Eventually there will be a way to disable the auto-text functions (automatic caps especially).
  
  
 
Verified to work as typed by optik678 and hopspitfire.
 
Verified to work as typed by optik678 and hopspitfire.

Revision as of 01:12, 21 July 2009

Most people are reporting that ajaxphpterm works better than this method. You might want to try that one first ...

This article will allow you to use your web browser on your Pre for a terminal. You should have already rooted your Pre and installed an SSH server, enabled sudo and set up the optware repositories.

1. SSH into your Pre. 2. Download Webshell:

wget http://web-shell.googlecode.com/files/WebShell-0.9.6.zip

3. Install Python:

sudo /opt/bin/ipkg-opt install python

4. Extract the contents of WebShell-0.9.6.zip:

unzip WebShell-0.9.6.zip

5. Generate a server certificate:

cd WebShell-0.9.6
sh ./make_certificate.sh

6. Move WebShell to /opt/share/webshell:

cd ..
sudo mv WebShell-0.9.6/ /opt/share/webshell

7. Create an upstart script "/etc/event.d/webos-webshell" with the following contents:

start on stopped finish
stop on runlevel [!2]

console none

respawn

exec /opt/bin/python /opt/share/webshell/webshell.py -c "/opt/bin/ssh -p 222 -l $USER localhost" --ssl-disable

where $USER is replaced by your user name.

8. Restart the Pre.

9. Open up your web browser and go to

http://127.0.0.1:8022

10. Type in your password and you now have a shell. You can run any commands you want now directly on your phone.

Note If it looks like you are seeing a bunch of text flash at the top of the screen, rotate your phone into Landscape mode, hit the enter key a bunch of times. You will either be able to see the error and can fix it through your version of SSH or you will get a disconnection message. If you do get a disconnected message, hit Refresh and try to login. It should start working then.

Note Eventually there will be a way to disable the auto-text functions (automatic caps especially).


Verified to work as typed by optik678 and hopspitfire.