PDA

View Full Version : start sshd at boot time



lothario
03-19-2004, 06:04 AM
I use floppyconfig to boot.
How do I configure Knoppix to start sshd and generate keys - at boot time?
Assuming that I save my knoppix configuration before the re-boot.

I looked at various posts for sshd but being new to knoppix I had difficulty understanding the steps.

I need a simple and fast way to do this.

OErjan
03-19-2004, 09:17 PM
i have posted a scrip on this forum somewhere, it does almost what you want.
First it gives me Swedish keyboard, then it generates the keys (new every boot), then it starts sshd and asks for a password for knoppix (i use it to setup a cdbased sftpsession asap).


loadkeys se-latin1.kmap.gz; ssh-keygen -t rsa -f /etc/ssh/ssh_host_key; ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key; ssh-keygen -t rsa -f /etc/ssh/ssh_host_dsa_key; sshd; passwd knoppix
The loadkeys part you may edit to something that suits you (or remove entirely).
If you want to save things, hmmm save the /etc/ssh directory and copy it back after reboot (with a script perhaps) then in the same scipt you can start the sshd like i did.
was it clear ? if not ask on.

firebyrd10
03-19-2004, 10:10 PM
would that work with anything? such as hdparm -S 2 /dev/hda

OErjan
03-19-2004, 10:27 PM
you could put that in lilo if i remember corectly. or in a early rc. file.

firebyrd10
03-19-2004, 10:39 PM
well i'm trying to get knoppix to do that when I boot it up, I saved the config and I was wondering if I couold edit it to do that.

lothario
03-20-2004, 02:09 PM
a few questions:

1. why does the /etc/ssh directory need to be saved?

2. i saved your code on my floppy but i assume i need to run this code as root (correct?) my system logs me in as the default user knoppix
so how do i run this script as root?

rrijkse
04-29-2004, 09:47 AM
1. The /etc/ssh directory doesn't need to be saved, but if you save it and incorporate it into the knoppix image using remastering, the keys that are generated will be the same keys evertime you boot. If you don't save them they are re-generated everytime.

2. To login as user root, you type "sudo" before the command.

Ex. sudo passwd knoppix

Hope this helps

- Robbert