SSH

(password-less login for ssh)
Line 1: Line 1:
SSH (Secure SHell) is a network protocol that allows you to access a terminal shell remotely. This is particularly useful when performing complicated console operations on the tablet where their limited text-input may get in the way.
SSH (Secure SHell) is a network protocol that allows you to access a terminal shell remotely. This is particularly useful when performing complicated console operations on the tablet where their limited text-input may get in the way.
-
== OpenSSH ==
+
== Flavours to install on your device ==
 +
=== OpenSSH ===
-
OpenSSH is the preferred client and server package. It is available in [[Extras]]. You can install either only the client or server, or both depending on your particular use-case. Be aware that the installation may take a while and appear frozen, as SSH keys have to be generated during the install.
+
OpenSSH is the most common client and server package. It is available in [[Extras]]. You can install either only the client or server, or both depending on your particular use-case. Be aware that the installation may take a while and appear frozen, as SSH keys have to be generated during the install.
-
== Usage ==
+
=== Dropbear ===
 +
Dropbear is an alternative ssh client/server package which uses less disk/memory.
 +
 
 +
== On-device Usage ==
=== Client ===
=== Client ===
 +
To allow you to use your tablet/phone to connect to other machines.
You can connect to a remote machine from the tablet by running <code>ssh ''user''@''server ip''</code>. This will give you a remote shell on the server machine.
You can connect to a remote machine from the tablet by running <code>ssh ''user''@''server ip''</code>. This will give you a remote shell on the server machine.
=== Server ===
=== Server ===
 +
To allow other machines to connect to your tablet/phone.
If you wish to access a shell on the tablet from a remote machine (to edit a local file with a real keyboard, perhaps), then all that you need to do is make sure OpenSSH server is installed on the tablet and <code>ssh root@''tablet ip''</code>
If you wish to access a shell on the tablet from a remote machine (to edit a local file with a real keyboard, perhaps), then all that you need to do is make sure OpenSSH server is installed on the tablet and <code>ssh root@''tablet ip''</code>
 +
 +
Note that N900's are called "Nokia-N900-41-10" if allocated an IP address via DHCP (see [https://bugs.maemo.org/show_bug.cgi?id=2758 this bug])
== PuTTY ==
== PuTTY ==
-
PuTTY is a client for the SSH & [the insecure] Telnet protocols. It is a popular client for Microsoft Windows, *Nix Operating Systems with ports even existing for Symbian phones, Windows Mobile and even the internet tablet itself. It can be used to connect to a tablet running OpenSSH to get a remote shell.
+
PuTTY is a client for the SSH & [the abysmally insecure] Telnet protocols. It is a popular client for Microsoft Windows, *Nix Operating Systems with ports even existing for Symbian phones, Windows Mobile and even the internet tablet itself. It can be used to connect to a tablet running OpenSSH to get a remote shell.
=== Usage ===
=== Usage ===
Line 28: Line 36:
# Press Open and enter the name of the user you wish to connect as when prompted. (root is commonly used)
# Press Open and enter the name of the user you wish to connect as when prompted. (root is commonly used)
 +
=== Extra security AND convenience ===
 +
It is fairly easy to generate a secure key to allow password-less login to the device. Provided you keep the key secure then this is actually much more secure than using a password.
 +
 +
Make sure you can ssh into the device.
 +
 +
On the device you need to create a directory in the appropriate users home directory:
 +
  cd
 +
  mkdir .ssh
 +
  chmod 700 .ssh
 +
 +
Back on the linux box run the following command and take the defaults:
 +
  ssh-keygen -t rsa
 +
You'll find a file in your home directory called .ssh/id_rsa.pub and .ssh/id_rsa
 +
The .pub one is allowed out in public - you give it to other machines. The other one must be kept private.
 +
 +
 +
Then if you use openSSH:
 +
scp .ssh/id_rsa.pub <user>@<device>:.ssh/authorized_keys2
 +
For dropbear:
 +
scp .ssh/id_rsa.pub <user>@<device>:.ssh/authorized_keys
 +
This will ask for the password to copy across the key.
 +
 +
Now try:
 +
ssh <user>@<device>
 +
and you should just get a shell login.
[[Category:Users]]
[[Category:Users]]
[[Category:Connectivity]]
[[Category:Connectivity]]

Revision as of 16:04, 17 October 2009

SSH (Secure SHell) is a network protocol that allows you to access a terminal shell remotely. This is particularly useful when performing complicated console operations on the tablet where their limited text-input may get in the way.

Contents

Flavours to install on your device

OpenSSH

OpenSSH is the most common client and server package. It is available in Extras. You can install either only the client or server, or both depending on your particular use-case. Be aware that the installation may take a while and appear frozen, as SSH keys have to be generated during the install.

Dropbear

Dropbear is an alternative ssh client/server package which uses less disk/memory.

On-device Usage

Client

To allow you to use your tablet/phone to connect to other machines.

You can connect to a remote machine from the tablet by running ssh user@server ip. This will give you a remote shell on the server machine.

Server

To allow other machines to connect to your tablet/phone.

If you wish to access a shell on the tablet from a remote machine (to edit a local file with a real keyboard, perhaps), then all that you need to do is make sure OpenSSH server is installed on the tablet and ssh root@tablet ip

Note that N900's are called "Nokia-N900-41-10" if allocated an IP address via DHCP (see this bug)

PuTTY

PuTTY is a client for the SSH & [the abysmally insecure] Telnet protocols. It is a popular client for Microsoft Windows, *Nix Operating Systems with ports even existing for Symbian phones, Windows Mobile and even the internet tablet itself. It can be used to connect to a tablet running OpenSSH to get a remote shell.

Usage

  1. Load up PuTTY on the machine you want to connect to the tablet from.
    1. You should see the window titled "PuTTY Configuration" and the "Session" category selected.
  2. Ensure "SSH" is selected as the "Connection type:" and enter the tablet's ip in the "Host Name (or IP address)" section.
  3. If you need to change any other settings out of necessity or personal preference for example, go and change settings as required.
  4. If you want to save these settings for future use to connect to the tablet quickly, add a name in "Saved Sessions" and press Save.
  5. Press Open and enter the name of the user you wish to connect as when prompted. (root is commonly used)

Extra security AND convenience

It is fairly easy to generate a secure key to allow password-less login to the device. Provided you keep the key secure then this is actually much more secure than using a password.

Make sure you can ssh into the device.

On the device you need to create a directory in the appropriate users home directory:

 cd
 mkdir .ssh
 chmod 700 .ssh

Back on the linux box run the following command and take the defaults:

 ssh-keygen -t rsa

You'll find a file in your home directory called .ssh/id_rsa.pub and .ssh/id_rsa The .pub one is allowed out in public - you give it to other machines. The other one must be kept private.


Then if you use openSSH:

scp .ssh/id_rsa.pub <user>@<device>:.ssh/authorized_keys2

For dropbear:

scp .ssh/id_rsa.pub <user>@<device>:.ssh/authorized_keys

This will ask for the password to copy across the key.

Now try:

ssh <user>@<device>

and you should just get a shell login.

Retrieved from "https://wiki.maemo.org/SSH"