How can I save /etc/dropbear/ during a reboot?

Discussion in 'Tomato Firmware' started by sofakng, Sep 1, 2009.

  1. sofakng

    sofakng Network Guru Member

    I'd like to change my dropbear_rsa_host_key which is located inside /etc/dropbear.

    I can change this file just fine but when I reboot it gets lost.

    How can I permanently change this file?
     
  2. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    Code:
    nvram set sshd_hostkey="newhostkeyhereinbase64"
    nvram commit
     
  3. sofakng

    sofakng Network Guru Member

    Ok, so first I generate the private key from dropbearkey and then I stick that into that nvram command?

    I'm really sorry, but how would I get that to work?

    dropbearkey -t rsa -f new.key
    nvram set sshd_hostkey="`echo new.key`"

    ?
     
  4. Planiwa

    Planiwa Network Guru Member

    cat will work better than echo :)
     
  5. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    You also need to make it base64. I don't think it is by default
    Code:
    openssl enc -base64 -in new.key -out new.b64
     
  6. teddy_bear

    teddy_bear Network Guru Member

    Unless you want to use a specific key, you can have Tomato/dropbear to autogenerate the key for you:
    Code:
    nvram unset sshd_hostkey
    nvram commit
    reboot
    Next time Tomato starts dropbear, it will create a new hostkey.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice