PDA

View Full Version : Remote rescue over ssh



SynrG
06-18-2004, 07:38 PM
I need to be able to ship a remastered Knoppix with our OpenVMS servers to be used from an attached PC (via serial cable) in case we need to do an emergency rescue of the OpenVMS server.

The idea is that the user booting the Knoppix CD has probably never seen Knoppix before, doesn't care to learn it, and will need to be guided through the process on the phone, so minimizing user dialogue and total number of steps to explain is important.

Ideally the system boots and configures network (as Knoppix does already,) assigns a random password (or prompts user to enter one) tells the user the ip#/password to let the "expert" at the other end of the phone know, and starts sshd so the "expert" can login with the supplied ip# & password.

The rest of the rescue is performed by the expert, who starts minicom (preconfigured with the appropriate settings) to service the OpenVMS server attached to the PC with a serial cable.

Knoppix is my first choice because it is based on Debian, with which I am already familiar, has a good reputation, is kept up-to-date, and remastering is a well-practiced art among the Knoppix user community.

Has anyone already remastered Knoppix in the way I describe? I took a look at the list of remasterings, and didn't see any that matched my needs.

nayr
06-18-2004, 08:34 PM
ya this is easy, edit /usr/sbin/sshstart on your remaster and put the following line at the begining of the script..

echo "knoppix:DEFAULTPASSWD" | chpasswd

then comment out the messages that prompt before the window closes, it should look like this:

#echo -n "$MESSAGE"
#read a

now when startssh is ran it wont require any user interaction.. so then I edited
/etc/X11/Xsession.d/45xsession and put the line
/usr/sbin/sshstart
after where the linuxtag desktop icons are created...

then you can make a webpage on your server that when opened it logs the time and the ip address of the visitor.. then put a script in /etc/network/ifup.d/ that opens that webpage, something simple like "wget http://yoursite.com/support/callhome.php -O /dev/null"

then all the customer has to do is boot and get it on the internet, the cd will automatically call home and you can ssh in with the default passwd and start doing whatever you want..

I am in the process of creating a support cdrom for the company I work for.. here soon we will ship our custom knoppix with every computer we sell (thousands a week) to assist our support staff in diagnosing and fixing people's computers..

SynrG
06-23-2004, 09:03 PM
That's very helpful. Thanks. Now I just need to figure out which remastering method is going to be least painful in the long term. I have been looking at Plugscript, and that looks promising.

Ambrose
06-29-2004, 03:19 AM
With my remote remasters, I've set the password either and bootup or during the remaster (passwd root) or the chpasswd method, started ssh, and done an "ifconfig -a | mail -s subject me@e-mail.com"

That way, once it is booted up, I get notified, and can ssh right in and do whatever needs to be done.

Good luck,

- Ambrose

SynrG
06-16-2005, 03:27 PM
I had to set this aside for a while. This month, I returned to the problem, following the remastering HOWTO from knoppix.net, and implementing nayr's suggestions. I did find one small glitch, which I have corrected. I'm recording it here for posterity, in case someone else is trying to do the same thing.

It does not appear that /etc/network/if-up.d/* hooks are triggered by the Knoppix autoconfigure script (/etc/rcS.d/S00knoppix-autoconfig,) because it sets up the connection without using the "ifup" script from Debian's ifupdown package, so putting the wget "callhome" in if-up.d/ does not work. I noticed, though, that pump is called by knoppix-autoconfig, so I added this line to /etc/pump.conf:

script /usr/local/sbin/pump_callhome

And then I created /usr/local/sbin/pump_callhome & made it executable. Here's the revised example:

#!/bin/sh
case $1 in
up | renewal)
wget -q http://yoursite.com/support/callhome.php
;;
esac

I have tested this with Knoppix 3.9.