Dropbear: Difference between revisions

From RidgeRun Developer Wiki
Line 49: Line 49:
  DROPBEAR_EXTRA_ARGS=-s
  DROPBEAR_EXTRA_ARGS=-s


After do that, rebuild and reinstall the application.
After do that, rebuild and reinstall the application, then start the Dropbear server running the following script:


If you want to add this option in the target fs direclty, you need to do the same action in the script /etc/init.d/dropbear. After that, restart the application  
/etc/init.d/dropbear start
 
The first time that you run this script, you can see in log some messages about generating public and private keys, you can take the public key to add it in host computer, if Dropbear was started at this point, you can get the public key manually, this process must be explained in the following section.
 
If you want to add this option in the target fs directly, you need to do the same action in the script /etc/init.d/dropbear. After that, restart the application  


  /etc/init.d/dropbear restart  
  /etc/init.d/dropbear restart  


===How to get public and private keys of Dropbear in the target manually===
===How to get public and private keys of Dropbear in the target manually===


You can use "dropbearkey" tool to create public and private keys or see public keys
You can use "dropbearkey" tool to create public and private keys or see public keys.


To create an pair of keys you can run the following command:
To create an pair of keys you can run the following command:


  $ dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
  $ dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
The last command saves in ''/etc/dropbear/dropbear_rsa_host_key'' the private key, and prints the public key. If you want to get only the public key as you need to save in the authorized keys in the host, you can run the commmand
$ dropbearkey -y -f /etc/dropbear/dropbear_rsa_host_key | grep ssh-rsa


===How to set public key of Dropbear in the host===
===How to set public key of Dropbear in the host===

Revision as of 08:21, 19 May 2010

Dropbear is a relatively small SSH server and client. It runs on a variety of POSIX-based platforms. Dropbear is particularly useful for "embedded" type Linux systems

Enabling dropbear

How to enable Dropbear server

1-Open sdk configuration system

$ make config

2- Enable Dropbear server:

-> File System Configuration
  -> Select target's file system software 
    [*] dropbear-0.52 (SSH Server)

3- When you check Dropbear server, you can enable scp and ssh

-*- dropbear-0.52 (SSH Server)
[*]   Enable dbclient (SSH Client)
[*]   Enable scp

Starting dropbear server

To start the server you can use the script located in /etc/init.d/ named "dropbear"

/etc/init.d/dropbear start

When you run this command, normally you can see some messages about keys, you can get of this log

Commands to use ssh

$ dbclient user@host 

Commands to use scp

$ scp <file> user@host:/<location>

Setting keys to get ssh connections without password requests

To enable this option you need to add "-s" option at the start server command, it can be added in the devdir fs or in the target fs directly.

If you want to add this option in the devdir, open the file <DEVDIR>/fs/apps/dropbear.x.y/dropbear and add the option "-s" in the flag DROPBEAR_EXTRA_ARGS of the following way:

DROPBEAR_EXTRA_ARGS=-s

After do that, rebuild and reinstall the application, then start the Dropbear server running the following script:

/etc/init.d/dropbear start 

The first time that you run this script, you can see in log some messages about generating public and private keys, you can take the public key to add it in host computer, if Dropbear was started at this point, you can get the public key manually, this process must be explained in the following section.

If you want to add this option in the target fs directly, you need to do the same action in the script /etc/init.d/dropbear. After that, restart the application

/etc/init.d/dropbear restart 

How to get public and private keys of Dropbear in the target manually

You can use "dropbearkey" tool to create public and private keys or see public keys.

To create an pair of keys you can run the following command:

$ dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key

The last command saves in /etc/dropbear/dropbear_rsa_host_key the private key, and prints the public key. If you want to get only the public key as you need to save in the authorized keys in the host, you can run the commmand

$ dropbearkey -y -f /etc/dropbear/dropbear_rsa_host_key | grep ssh-rsa

How to set public key of Dropbear in the host

How to get public and private keys of OpenSSH in the host

How to set public key of OpenSSH in the target

Commands to use ssh without password request

$ dbclient user@host -i /etc/dropbear/dropbear_rsa_host_key

Commands to use scp without password request

$ scp <file> user@host:/<location> -i /etc/dropbear/dropbear_rsa_host_key