Ssh into the XO: Difference between revisions
No edit summary |
No edit summary |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
⚫ | |||
{{dated}} |
|||
⚫ | |||
== On the XO == |
== On the XO == |
||
=== Enable remote login === |
|||
On OLPC OS, remote login is disabled by default. To enable it, start the [[Terminal]] activity and then copy and paste these two lines: |
|||
sudo chkconfig sshd on |
|||
sudo service sshd start |
|||
=== Set a password for root === |
=== Set a password for root === |
||
By default, root does not have a password |
By default, ''root'' does not have a password, and therefore cannot be used for for remote login. To set a password for ''root'', start the [[Terminal]] activity and then copy and paste this line: |
||
⚫ | |||
Follow the prompts. This is what it might look like: |
|||
* Open the [[Terminal]] Activity |
|||
[olpc@xo-a7-4b-33 ~]$ sudo passwd |
|||
* Become root by typing (at the prompt) |
|||
Changing password for user root. |
|||
<code> |
|||
New password: |
|||
su |
|||
Retype new password: |
|||
</code> |
|||
passwd: all authentication tokens updated successfully. |
|||
* Set your password (follow the prompts). |
|||
[olpc@xo-a7-4b-33 ~]$ |
|||
<code> |
|||
⚫ | |||
</code> |
|||
=== Find |
=== Find the IP address === |
||
Remote login needs a host name or IP address. To find the IP address, right-click on the network device icon in the frame. The IP address will be shown. |
|||
Then we need to find the IP address we are sshing to. Still using Terminal: |
|||
If that doesn't work, we have an old method still available; use the Terminal activity copy and paste this line: |
|||
<code> |
|||
⚫ | |||
</code> |
|||
⚫ | |||
This will display a lot of text. Look at the first block (prompted by eth0)-the "inet addr:" gives you the IP address; what you're looking for is the string of numbers (4 numbers separated by periods). |
|||
This will display a lot of text. Like this: |
|||
eth0 Link encap:Ethernet HWaddr 00:17:C4:A7:4B:33 |
|||
inet addr:10.0.0.172 Bcast:10.0.0.255 Mask:255.255.255.0 |
|||
inet6 addr: fe80::217:c4ff:fea7:4b33/64 Scope:Link |
|||
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 |
|||
RX packets:34 errors:0 dropped:0 overruns:0 frame:0 |
|||
TX packets:64 errors:0 dropped:0 overruns:0 carrier:0 |
|||
collisions:0 txqueuelen:1000 |
|||
RX bytes:5537 (5.4 KiB) TX bytes:17090 (16.6 KiB) |
|||
You can find the IP address in the second line, just after the words ''inet addr:''. It should be four numbers separated by periods. In the example above, the IP address is 10.0.0.172. |
|||
== On the other computer == |
== On the other computer == |
||
You will need an SSH client program. Some computers have one already, some need one installed. See Wikipedia's [http://en.wikipedia.org/wiki/Comparison_of_SSH_clients comparison of SSH clients]. |
|||
Now open up a terminal on the other computer you want to ssh in from. |
|||
Give ''root@IP'' to your SSH client program, where IP is the IP address of the XO you wish to login to. You will be prompted for the password. You'll see a shell prompt once login is successful. |
|||
=== Linux or Mac OS X === |
|||
Both Linux and Mac OS X typically have SSH installed already. |
|||
Start the Terminal application, then type: |
|||
⚫ | |||
=== Another XO === |
|||
Any XO running OLPC OS will have SSH installed already. |
|||
Start the Terminal activity, then type: |
|||
ssh root@IP |
|||
* '''Linux and Mac OS X''' users should already have a built-in terminal application: in that terminal, type |
|||
=== Microsoft Windows === |
|||
<code> |
|||
⚫ | |||
</code> |
|||
Microsoft Windows does not include an SSH client program by default. |
|||
where <ip-address> is replaced by the IP address for your XO. |
|||
See [http://en.wikipedia.org/wiki/Comparison_of_SSH_clients Comparison of SSH clients]. One client regularly suggested is [http://en.wikipedia.org/wiki/PuTTY PuTTY]. Run the program, then type |
|||
* '''Windows users''' will want to [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html download puTTY], launch the .exe, and type root@<ip-address> in the ip address entry field, and hit "Open." (hit "Yes" for any pop-ups that come up.) |
|||
root@IP |
|||
in the ip address entry field, then press "Open". |
|||
== Troubleshooting == |
|||
You'll be prompted for a password either way; use the one you just set for root. |
|||
If you have enabled automatic power management it may cause trouble connecting or remaining connected. Wake up the XO for the initial connection. XO-1.5, XO-1.75 and XO-4 will wake up automatically when you begin typing inside an SSH connection. Turn off automatic power management if it is not needed. |
|||
You'll see a shell prompt if you are successful. |
Latest revision as of 01:22, 6 November 2015
Sometimes you'll want to access your XO from another computer. To do this, we can use SSH. Here's how.
On the XO
Enable remote login
On OLPC OS, remote login is disabled by default. To enable it, start the Terminal activity and then copy and paste these two lines:
sudo chkconfig sshd on sudo service sshd start
Set a password for root
By default, root does not have a password, and therefore cannot be used for for remote login. To set a password for root, start the Terminal activity and then copy and paste this line:
sudo passwd
Follow the prompts. This is what it might look like:
[olpc@xo-a7-4b-33 ~]$ sudo passwd Changing password for user root. New password: Retype new password: passwd: all authentication tokens updated successfully. [olpc@xo-a7-4b-33 ~]$
Find the IP address
Remote login needs a host name or IP address. To find the IP address, right-click on the network device icon in the frame. The IP address will be shown.
If that doesn't work, we have an old method still available; use the Terminal activity copy and paste this line:
sudo ifconfig eth0
This will display a lot of text. Like this:
eth0 Link encap:Ethernet HWaddr 00:17:C4:A7:4B:33 inet addr:10.0.0.172 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::217:c4ff:fea7:4b33/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:34 errors:0 dropped:0 overruns:0 frame:0 TX packets:64 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:5537 (5.4 KiB) TX bytes:17090 (16.6 KiB)
You can find the IP address in the second line, just after the words inet addr:. It should be four numbers separated by periods. In the example above, the IP address is 10.0.0.172.
On the other computer
You will need an SSH client program. Some computers have one already, some need one installed. See Wikipedia's comparison of SSH clients.
Give root@IP to your SSH client program, where IP is the IP address of the XO you wish to login to. You will be prompted for the password. You'll see a shell prompt once login is successful.
Linux or Mac OS X
Both Linux and Mac OS X typically have SSH installed already.
Start the Terminal application, then type:
ssh root@IP
Another XO
Any XO running OLPC OS will have SSH installed already.
Start the Terminal activity, then type:
ssh root@IP
Microsoft Windows
Microsoft Windows does not include an SSH client program by default.
See Comparison of SSH clients. One client regularly suggested is PuTTY. Run the program, then type
root@IP
in the ip address entry field, then press "Open".
Troubleshooting
If you have enabled automatic power management it may cause trouble connecting or remaining connected. Wake up the XO for the initial connection. XO-1.5, XO-1.75 and XO-4 will wake up automatically when you begin typing inside an SSH connection. Turn off automatic power management if it is not needed.