ebalaskas.gr: Chrooted Drop Bear ...

Home Page | Index | Changes | Comments | Users | Registration | Σύνδεση  Συνθηματικό:  
 

Hits : 361


Chrooted Drop Bear :: HowTo


This tutorial is being written to help you install Drop Bear to a chroot environment.
It covers the below sections:


* Installation of Drop Bear
* Setup Drop Bear
* Setup Chroot Enviroment
* Debug Chrooted Drop Bear


Περιεχόμενα

Drop Bear


Dropbear is a relatively small SSH 2 server and client.
It is an alternative lightweight program of openssh and it is designed for environments with low memory and processor resources, such as embedded systems.


http://matt.ucc.asn.au/dropbear/dropbear.html


top


Installation

Download


Extract


Configuration


In our installation we choose: /chroot/dropbear as the root path of our chroot environment
And for educational purpose only, we change the default TCP port of ssh to 2222:


Compilation


Simple as that:


Installation


The default installation process:



top


Keys


The next step is to create dss & rsa keys for dropbear ssh server.


We must create the dropbear's key folder first:



and then:


As you can see, we used the chroot environment path without the need of our distribution path hierarchy.
The Drop Bear's? keys are already installed to our chroot environment at once.


top


Shared Libraries


We now have to check all the necessaries shared libraries that dropbear needs to run inside a chroot environment



top


Chroot Environment

Structure



top


Libraries



top


Extra Libraries


This libraries are mostly for the authentication process.



top


Files


Copy necessaries files from root to chroot



top


Devices


We now must be very careful with the next step of our process.
We have to create all the necessaries devices for dropbear to run


(Remember, we are always on the chroot path – eg. /chroot/dropbear)



top


Users


Of course we need to add users to our chroot dropbear setup.
You can choose to add an existence user or you can create a new one.
I prefer to add an existence user (eg. ebal):



top


Shell


Every user needs a shell!
But we dont need to install bash, we can simple use busybox.
Busybox is a lightweight shell and combines a lot of common unix utils into a small executable binary file.



top


Mount Points


This is the most important thing that we (you) have to do properly.
The new environment needs access to terminals (this is necessary for a user to login) and to proc filesystem.



top


Run 


Finally we are ready to run Drop Bear from a chroot enviroment:



top


Debug


But if something goes wrong, we can always debug the running process with strace:



top



 
Χρόνος: 0.041 s
Μνήμη: 2.022 Mb

Valid XHTML 1.0 Transitional