Friday, March 9, 2012

Configure SSH server on Linux MicroCore



Here is an interesting article on MicroCore Linux,I haven't tried it on,can be useful though.



1. Start Microcore with Qemu

qemu ./linux-microcore-2.11.5.img

After boot you should see a prompt.

2. Check if openssh extension is installed

ls /mnt/hda1/tce/optional/openssh*
/mnt/hda1/tce/optional/openssh.tcz
/mnt/hda1/tce/optional/openssh.tcz.dep
/mnt/hda1/tce/optional/openssh.tcz.md5.txt

If you can't see the files above you should get them first. Run this command in terminal:

tc-load -w openssh

Make openssh extension being loaded during the boot of Microcore Linux:

echo "openssh.tcz" >> /mnt/hda1/tce/onboot.lst


3. Start openssh daemon (as a root)

/usr/local/etc/init.d/openssh start

You can see is an error message about missing sshd-config configuration file. So we need to create it.

mv /usr/local/etc/ssh/sshd_config.example /usr/local/etc/ssh/sshd_config

If you don't edit sshd_config file all the uncomment lines are used by default by opennssh deamon . Now we may run openssh again.

/usr/local/etc/init.d/openssh start

First time you successfully start openssh daemon, the public/private rsa key pair and public/private dsa key are generated.

4. Automatic start openssh deamon after boot of Microcore

echo "/usr/local/etc/init.d/openssh start" >> /opt/bootlocal.sh

5. Backup of configuration directory "/usr/local/etc/ssh" 

echo "/usr/local/etc/ssh" >> /opt/.filetool.lst
/usr/bin/filetool.sh backup

6. Test ssh server (password is root)

ssh root@localhost

You should be able to login now.

No comments:

Post a Comment