SSHLiveCD

HOWTO SSH into a LiveCD

This HOWTO describes how to SSH into a LiveCD environment.

Why?!

To put it simply: Diagnosing problems.

Sometimes when the LiveCD is not working correctly, you may want to extract logs from it to diagnose the problem. However if it is seemingly impossible to get to a TTY to see those logs, you need to think outside the square.

Aside from that, why not ssh to a LiveCD Smile :)

How

You will need two machines (or a LiveCD in a VM).

Boot the LiveCD to the Menu.

Hit F6, and add 'single' to the boot options.

Continue booting the CD. You should end up at a text prompt that looks like this:

root@ubuntu: ~

Install openssh-server

apt-get install openssh-server

Set the password for the root user:

root@ubuntu:~# passwd
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
root@ubuntu:~# 

On the second machine (or the host in the case of a VM):

Replace '192.168.0.2' with your second machine's IP or domain

user@first:~$ ssh root@192.168.0.2
The authenticity of host '192.168.0.2 (192.168.0.2)' can't be established.
RSA key fingerprint is 82:73:ff:6f:dc:a0:67:4a:28:f4:ee:a4:a8:42:10:3d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.2' (RSA) to the list of known hosts.
root@192.168.0.2's password: 
Linux ubuntu 2.6.22-8-generic #1 SMP Thu Jul 12 15:59:45 GMT 2007 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
root@ubuntu:~# 

Hooray! You're in!

Problems

If you are SSHing to a domain or IP that is already in your known_hosts file, you will probably get something like:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
89:c1:57:99:70:4a:9b:c5:ef:73:79:48:8f:28:a2:43.
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending key in /home/user/.ssh/known_hosts:2
RSA host key for 192.168.0.2 has changed and you have requested strict checking.
Host key verification failed.
user@first:~$

You will need to either replace or remove the offending entry.

SSHLiveCD (last edited 2008-08-06 16:59:50 by localhost)