Difference between revisions of "OpenSSH Install"

From WebOS Internals
Jump to navigation Jump to search
Line 1: Line 1:
 +
OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.
 +
 +
Just install the OpenSSH package directly in Preware, and follow the instructions in the HomePage link in the package description in Preware.
 +
 +
OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.
 +
 
==Install OpenSSH==
 
==Install OpenSSH==
 
<pre><nowiki>
 
<pre><nowiki>
Line 4: Line 10:
 
</nowiki></pre>
 
</nowiki></pre>
 
Note that the default configuration of OpenSSH does '''not''' enable SFTP.  Since SCP just uses basic SSH, that works.
 
Note that the default configuration of OpenSSH does '''not''' enable SFTP.  Since SCP just uses basic SSH, that works.
 +
 +
OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.
  
 
==Kill the OpenSSH daemon automatically started by ipkg==
 
==Kill the OpenSSH daemon automatically started by ipkg==
Line 9: Line 17:
 
killall sshd
 
killall sshd
 
</nowiki></pre>
 
</nowiki></pre>
 +
 +
OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.
  
 
==Mount the file system as readwrite==
 
==Mount the file system as readwrite==
Line 15: Line 25:
 
mount -o remount,rw /
 
mount -o remount,rw /
 
</nowiki></pre>
 
</nowiki></pre>
 +
 +
OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.
  
 
==Install an upstart event for the OpenSSH daemon==
 
==Install an upstart event for the OpenSSH daemon==
Line 21: Line 33:
 
wget http://gitorious.org/webos-internals/bootstrap/blobs/raw/master/etc/event.d/optware-openssh
 
wget http://gitorious.org/webos-internals/bootstrap/blobs/raw/master/etc/event.d/optware-openssh
 
</nowiki></pre>
 
</nowiki></pre>
 +
 +
OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.
  
 
==[Optional step]  Connecting to your pre over 3G (EVDO, UMTS) or WiFi==
 
==[Optional step]  Connecting to your pre over 3G (EVDO, UMTS) or WiFi==
Line 28: Line 42:
 
Look at the script starting openssh:
 
Look at the script starting openssh:
 
<pre><nowiki>cat /etc/event.d/optware-openssh</nowiki></pre>
 
<pre><nowiki>cat /etc/event.d/optware-openssh</nowiki></pre>
 +
 +
OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.
  
 
==Start the OpenSSH daemon for testing==
 
==Start the OpenSSH daemon for testing==
Line 33: Line 49:
 
initctl start optware-openssh
 
initctl start optware-openssh
 
</nowiki></pre>
 
</nowiki></pre>
 +
 +
OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.
  
 
==Obtain the IP address of your Pre==
 
==Obtain the IP address of your Pre==
Line 46: Line 64:
  
 
Alternatively, you can install the Preware application "What is my IP?" for a convenient GUI to lookup IPs on all your interfaces.
 
Alternatively, you can install the Preware application "What is my IP?" for a convenient GUI to lookup IPs on all your interfaces.
 +
 +
OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.
 +
 
==Test your SSH installation==
 
==Test your SSH installation==
 
'''DO NOT CLOSE YOUR TELNET SESSION YET.  DO THIS IN A NEW WINDOW ''' From a remote system SSH to your Pre using //your// username and port 222. For example, from a Linux desktop you would run.
 
'''DO NOT CLOSE YOUR TELNET SESSION YET.  DO THIS IN A NEW WINDOW ''' From a remote system SSH to your Pre using //your// username and port 222. For example, from a Linux desktop you would run.
Line 54: Line 75:
  
 
Logout when done with "exit".
 
Logout when done with "exit".
 +
 +
OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.
  
 
==Remount the file system as readonly==
 
==Remount the file system as readonly==
Line 59: Line 82:
 
mount -o remount,ro /
 
mount -o remount,ro /
 
</nowiki></pre>
 
</nowiki></pre>
 +
 +
OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.
  
 
==Reboot your device==
 
==Reboot your device==
Line 66: Line 91:
  
 
Confirm that you can still access it after it boots using SSH.
 
Confirm that you can still access it after it boots using SSH.
 +
 +
OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.
  
 
==Optionally disable dev mode.==
 
==Optionally disable dev mode.==
Line 71: Line 98:
  
 
= Return to the [[Next_steps | Next Steps ]] page.=
 
= Return to the [[Next_steps | Next Steps ]] page.=
 +
 +
OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.
  
 
= Credits:=
 
= Credits:=
Line 78: Line 107:
 
* Sargun for the original Telnet process
 
* Sargun for the original Telnet process
 
* zinge for validation of the process
 
* zinge for validation of the process
 +
 +
OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.
  
 
= See also=
 
= See also=
 
* http://www.nslu2-linux.org/wiki/Optware/HomePage
 
* http://www.nslu2-linux.org/wiki/Optware/HomePage
 
* [[optware-cross-compilation | Optware Cross Compilation]]
 
* [[optware-cross-compilation | Optware Cross Compilation]]

Revision as of 22:59, 12 July 2011

OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.

Just install the OpenSSH package directly in Preware, and follow the instructions in the HomePage link in the package description in Preware.

OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.

Install OpenSSH

ipkg-opt install openssh

Note that the default configuration of OpenSSH does not enable SFTP. Since SCP just uses basic SSH, that works.

OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.

Kill the OpenSSH daemon automatically started by ipkg

killall sshd

OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.

Mount the file system as readwrite

If your root filesystem is still mounted readonly, you will not be able to write for example to /etc/conf.d, which we'll be doing in the next step.

mount -o remount,rw /

OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.

Install an upstart event for the OpenSSH daemon

cd /etc/event.d/
wget http://gitorious.org/webos-internals/bootstrap/blobs/raw/master/etc/event.d/optware-openssh

OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.

[Optional step] Connecting to your pre over 3G (EVDO, UMTS) or WiFi

Generally, most seem to think that's a bad idea. Take a look at the script /etc/event.d/optware-openssh. Notice that it automatically modifies the firewalls rules to enable incoming SSH on port 222 over WiFi (interface eth0) connections only. Follow the directions in the script to enable SSH on all interfaces (including your 3G interface), if you wish.

Look at the script starting openssh:

cat /etc/event.d/optware-openssh

OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.

Start the OpenSSH daemon for testing

initctl start optware-openssh

OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.

Obtain the IP address of your Pre

Look for the "inet addr://Your.IP.Address//" to get the ip address for your WIFI connection:

ifconfig eth0

To get the ip address for your 3G (EVDO, UMTS) connection:

ifconfig ppp0 

Alternatively, you can install the Preware application "What is my IP?" for a convenient GUI to lookup IPs on all your interfaces.

OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.

Test your SSH installation

DO NOT CLOSE YOUR TELNET SESSION YET. DO THIS IN A NEW WINDOW From a remote system SSH to your Pre using //your// username and port 222. For example, from a Linux desktop you would run.

ssh -p 222 PRE-USERNAME@YOUR-PRE-IP-ADDR

From a Windows desktop we recommend using PuTTY.

Logout when done with "exit".

OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.

Remount the file system as readonly

mount -o remount,ro /

OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.

Reboot your device

reboot

Confirm that you can still access it after it boots using SSH.

OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.

Optionally disable dev mode.

You may choose to disable dev mode at this point. There is no security issue to leaving dev mode on.

Return to the Next Steps page.

OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.

Credits:

  • Upstart Dropbear script and general cleanup from Dax Kelson
  • Sudo recipe from greg963 at Precentral.net
  • Original SSH process is based on dreadchicken's work
  • Sargun for the original Telnet process
  • zinge for validation of the process

OBSOLETE OBSOLETE OBSOLETE: This page is obsolete.

See also