Enabling SSH access to Debian live USB

This is just a short post describing how you can USB boot from a Debian Live USB key and from this enable SSH access to the box. I do this often and it can be quite handy.

First create the USB key using the instructions in the post Create a Debian Live USB flash drive.

Then

1. Boot from the USB and select the “Live (586)” option.
2. Should you get timed out the password for the user “user” is “live”.
3. For Debian live you are not told the root password and you have to ‘sudo’ to do anything administrative.

We really need to do everything from now on as root so run:

sudo passwd root

to change the root password and then

sudo su - root
4. Next we need to edit the “/etc/ssh/sshd_config” file to allow remote access. In this file change:

PermitRootLogin yes
PasswordAuthentication yes
5 You need to restart the ssh daemon so run:

/etc/init.d/ssh restart
6. You should work out the IP of the system by running:

ifconfig

Obviously the IP is the one listed:

eth0      Link encap:Ethernet  HWaddr 00:1b:78:50:5d:4a
          inet addr:192.168.202.192  Bcast:192.168.202.255  Mask:255.255.255.0

You may find, like I did on one occasion that it only showed an IPv6 address for eth0, just restart the Debian live and hopefully it will be right the next time. For me I had left it idle for several days, maybe that was the issue.

7. At this point you should be able to connect to the system remotely, using Putty etc., but connect via the IP found from running ifconfig, in our case the IP was 192.168.202.237.