Jump to content

Dropbear: Difference between revisions

380 bytes added ,  6 December 2011
m
no edit summary
mNo edit summary
Line 1: Line 1:
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
[http://matt.ucc.asn.au/dropbear/dropbear.html 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==
==Enabling dropbear==


===How to enable Dropbear server===
===How to enable Dropbear server===


1-Open sdk configuration system  
1-Open sdk configuration system  


  $ make config
  cd $DEVDIR
make config


2- Enable Dropbear server:
2- Enable Dropbear server:
Line 22: Line 21:
  [*]  Enable dbclient (SSH Client)
  [*]  Enable dbclient (SSH Client)
  [*]  Enable scp
  [*]  Enable scp
4- You should also enabled some user and password management tools
-> File System Configuration
  -> Select target's file system software
    -> Busybox configuration
        -> Login/Password Management Utilities
          [*] adduser
          [*] addgroup
          [*] deluser
          [*] passwd


===Starting dropbear server===
===Starting dropbear server===
Line 34: Line 44:


From target:
From target:
  $ dbclient user@host
  dbclient user@host


From host:
From host:
  $ ssh user@host
  ssh user@host


===Commands to use scp===
===Commands to use scp===


From target or host:
From target or host:
  $ scp <file> user@host:/<location>
  scp $LOCAL_FILE user@host:/$REMOTE_DIRECTORY


==Setting keys to get ssh connectivity without password requests==
==Setting keys to get ssh connectivity without password requests==


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


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  
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  


  DROPBEAR_EXTRA_ARGS=-s
  DROPBEAR_EXTRA_ARGS=-s
Line 70: Line 78:
To create an pair of keys, run the following command:
To create an pair of keys, 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. To show only the public key in the required format, run the commmand:
The last command saves in ''/etc/dropbear/dropbear_rsa_host_key'' the private key, and prints the public key. To show only the public key in the required format, run the commmand:


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


===How to set Dropbear public key in host===
===How to set Dropbear public key in host===
Line 107: Line 115:
Set the permissions correctly
Set the permissions correctly


  $ chmod go-w ~/
  chmod go-w ~/
  $ chmod 700 ~/.ssh
  chmod 700 ~/.ssh
  $ chmod 600 ~/.ssh/authorized_keys
  chmod 600 ~/.ssh/authorized_keys


After to do that, restart the Dropbear server using the following command:
After to do that, restart the Dropbear server using the following command:
Line 119: Line 127:
From host:
From host:


  $ ssh user@host
  ssh user@host


From target:
From target:


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


===Commands to use scp without password request===
===Commands to use scp without password request===


Form host:
Form host:
  $ scp <file> user@host:/<location>
  scp $LOCAL_FILE user@host:/$REMOTE_DIRECTORY


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




You can find more information about Dropbear in the site: http://www.nslu2-linux.org/wiki/HowTo/UseDropBearForRemoteAccess
There is more information about [http://www.nslu2-linux.org/wiki/HowTo/UseDropBearForRemoteAccessDropbear Remote Access].
Cookies help us deliver our services. By using our services, you agree to our use of cookies.