ssh from one dreambox to another. WAS Rsync on 800HD SE newnigma2

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    • ssh from one dreambox to another. WAS Rsync on 800HD SE newnigma2

      Hi, searching the web I've found some references to rsync and newnigma2.

      I would like some help to find out if it's possible to use rsync on my 800HD SE with Newnigma2 v3.1.1 and how to install it on my box. I've found some posts in German in the forum when i searched for rsync, but since my German is not "up to date" I'll be happy if someone can answer in English.
      dm8000hd sssc, dm800hdse sc

      Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von alexbore ()

    • RE: Rsync on 800HD SE newnigma2

      Thanks that worked. Rsync is now installed on the 800hd se.
      Now I need help with the following.

      1) I want my bouquets on my two dreamboxes to be synced between the two boxes. I want this to be daily I guess and I want the job to be started automatically and run in the background. The boxes are today on the same net with ip addresses and I can connect to them both with ssh.

      2) I'm also about to set up a new box in my summer house which I want to be synced as well. I will also be able to ssh to this box and I 'll use dyndns to access it from home.

      Anybody who can help me further on? Thanks.
      dm8000hd sssc, dm800hdse sc
    • RE: Rsync on 800HD SE newnigma2

      1.
      create SSH keys on source. Put public SSH key on target box in the correct place for the SSH service. As the box doesn't use OpenSSH that is the defacto standard I don't know if the key should be placed in the file /home/<USER>/.ssh/authorized_keys on target. Check that...

      2.
      Run a rsync cron job (just a simple "one-liner" in cron)



      /Per-Olov
    • RE: Rsync on 800HD SE newnigma2

      I've generated a key on the dm800hdse with dropbearkey using the command dropbearkey -t rsa -f /home/root/.ssh/dm800hdse_rsa_host_key

      This generates a private key which is put into the folder /home/root/.ssh/ on the dm800hdse

      I then use the command dropbearkey -y -f id_rsa | grep "^ssh-rsa " >> authorized_keys which adds the public key to the file authorized_keys on the same machine. I then copy the line from authorized_keys into the file authorized_keys on my other Dreambox (dm8000hd) in the folder /home/root/.ssh/

      However I'm still asked for a password each time I try to connect from the dm8000hd. What am I doing wrong?

      I've managed to put keys from my NAS server onto both dreamboxes and can now connect to both dreamboxes using ssh without using a password from the NAS. However the "same procedure" doesn't work as described above.

      Anybody who can help?
      dm8000hd sssc, dm800hdse sc
    • RE: Rsync on 800HD SE newnigma2

      If you generate a private and public key on a dm800 and copy the public part to a dm8000. Then you want to connect TO the dm8000. You describe the opposite....

      Also...
      Note that even if you are doing the right thing, problems could be (among alot of others):
      - wrong file permissions
      - key auth not enabled
      - etc etc
      if so... connect with debug flag and check.


      Note that I still don't really know (I have no need) if the file should be called authorized_keys on drop bear ssh. I have just described how it works in general...


      Regards
      /Per-Olov
    • RE: Rsync on 800HD SE newnigma2

      Just tried to... put a public DSA key from my linux server to:
      /home/root/.ssh/authorized_keys on my DM8000.

      server:~ #
      server:~ # ssh root@pvr.incedo.org
      root@dm8000:~#


      Works directly without a password... So it is authorized_keys on dropbear ssh as well.

      Hope this helps...

      Regards
      /Per-Olov
    • RE: Rsync on 800HD SE newnigma2

      I use authorized_keys from my pc, my NAS and my iphone directly to my dm8000hd box with no problem. I can also connect to my dm800hdse from my NAS without any problem. I haven't set up connections to the dm800hdse from my pc and iphone, but I'm sure this will work as well.

      However. To make a connection between the two dreamboxes I'm not able to do. I want to connect to the dm800hdse from the dm8000hd and vice versa using ssh and no password. I've tried using dss (dropbearkey -t dss) in addition to rsa, but it still doesn't work.

      Obviously I'm doing something wrong, but what?
      dm8000hd sssc, dm800hdse sc
    • RE: Rsync on 800HD SE newnigma2

      As a start you can try to run dropbear in foreground with "-F"on target. Also... check /var/log/messages on source and target host when connecting.

      I can later if it's not working for you try the opposite and use SSH keys to Linux from the DM8000. As I have one box I cannot run bwtween 2 DM:s.

      /Per-Olov
    • RE: Rsync on 800HD SE newnigma2

      Originally posted by pos42
      As a start you can try to run dropbear in foreground with "-F"on target. Also... check /var/log/messages on source and target host when connecting.

      I can later if it's not working for you try the opposite and use SSH keys to Linux from the DM8000. As I have one box I cannot run bwtween 2 DM:s.

      /Per-Olov


      Hi Per-Olov,

      What do you mean by running dropbear in the foreground? I typed in dropbear -f and got some commands, but what am I supposed to do?

      When i Connect from the dm8000hd to the dm800hdse the log from dm800hdse box in /var/log/messages prints:
      Dec 28 11:42:01 dm800se authpriv.info dropbear[961]: Child connection from 10.0.0.18:1929
      Dec 28 11:42:11 dm800se authpriv.notice dropbear[961]: password auth succeeded for 'root' from 10.0.0.18:1929

      When I connect from the NAS to the dm8000hd the log prints:
      Dec 28 11:52:51 dm8000 authpriv.info dropbear[17000]: Child connection from 10.0.0.220:39782
      Dec 28 11:52:52 dm8000 authpriv.notice dropbear[17000]: pubkey auth succeeded for 'root' with key md5 a4:54:ff:2f:31:5b:bf:d1:b4:af:0a:68:14:44:2a:ab from 10.0.0.220:39782

      I'm not able to connect without password to my NAS box running Linux with the public key from my dm800hdse. Again, I'm probably doing something wrong, but can't find out what.
      dm8000hd sssc, dm800hdse sc
    • RE: Rsync on 800HD SE newnigma2

      Originally posted by alexbore
      Originally posted by pos42
      As a start you can try to run dropbear in foreground with "-F"on target. Also... check /var/log/messages on source and target host when connecting.

      I can later if it's not working for you try the opposite and use SSH keys to Linux from the DM8000. As I have one box I cannot run bwtween 2 DM:s.

      /Per-Olov


      Hi Per-Olov,

      What do you mean by running dropbear in the foreground? I typed in dropbear -f and got some commands, but what am I supposed to do?

      When i Connect from the dm8000hd to the dm800hdse the log from dm800hdse box in /var/log/messages prints:
      Dec 28 11:42:01 dm800se authpriv.info dropbear[961]: Child connection from 10.0.0.18:1929
      Dec 28 11:42:11 dm800se authpriv.notice dropbear[961]: password auth succeeded for 'root' from 10.0.0.18:1929

      When I connect from the NAS to the dm8000hd the log prints:
      Dec 28 11:52:51 dm8000 authpriv.info dropbear[17000]: Child connection from 10.0.0.220:39782
      Dec 28 11:52:52 dm8000 authpriv.notice dropbear[17000]: pubkey auth succeeded for 'root' with key md5 a4:54:ff:2f:31:5b:bf:d1:b4:af:0a:68:14:44:2a:ab from 10.0.0.220:39782

      I'm not able to connect without password to my NAS box running Linux with the public key from my dm800hdse. Again, I'm probably doing something wrong, but can't find out what.


      Start dropbear with "-F" _not_ "-f"
      If you run it in foreground and not background, it's easier to see what is happening. Also.... Post the output on screen when running in foreground and the related logs from messages log. Also... post the log from the NAS (run with debug or verbose flag).

      /Per-Olov
    • RE: Rsync on 800HD SE newnigma2

      Originally posted by pos42
      Originally posted by alexbore
      Originally posted by pos42
      As a start you can try to run dropbear in foreground with "-F"on target. Also... check /var/log/messages on source and target host when connecting.

      I can later if it's not working for you try the opposite and use SSH keys to Linux from the DM8000. As I have one box I cannot run bwtween 2 DM:s.

      /Per-Olov


      Hi Per-Olov,

      What do you mean by running dropbear in the foreground? I typed in dropbear -f and got some commands, but what am I supposed to do?

      When i Connect from the dm8000hd to the dm800hdse the log from dm800hdse box in /var/log/messages prints:
      Dec 28 11:42:01 dm800se authpriv.info dropbear[961]: Child connection from 10.0.0.18:1929
      Dec 28 11:42:11 dm800se authpriv.notice dropbear[961]: password auth succeeded for 'root' from 10.0.0.18:1929

      When I connect from the NAS to the dm8000hd the log prints:
      Dec 28 11:52:51 dm8000 authpriv.info dropbear[17000]: Child connection from 10.0.0.220:39782
      Dec 28 11:52:52 dm8000 authpriv.notice dropbear[17000]: pubkey auth succeeded for 'root' with key md5 a4:54:ff:2f:31:5b:bf:d1:b4:af:0a:68:14:44:2a:ab from 10.0.0.220:39782

      I'm not able to connect without password to my NAS box running Linux with the public key from my dm800hdse. Again, I'm probably doing something wrong, but can't find out what.


      Start dropbear with "-F" _not_ "-f"
      If you run it in foreground and not background, it's easier to see what is happening. Also.... Post the output on screen when running in foreground and the related logs from messages log. Also... post the log from the NAS (run with debug or verbose flag).

      /Per-Olov



      Ok. Had a few minutes to test....

      ##ON my DM8000
      root@dm8000:~/.ssh# dropbearkey -t rsa -f mykey -s 1024
      root@dm8000:~/.ssh# dropbearkey -y -f mykey > dmpubkey
      root@dm8000:~/.ssh# scp dmpubkey MYUSERNAME@server.incedo.org:/tmp/


      ##ON target linux server
      MYUSERNAME@server:~/.ssh$cat /tmp/dmpubkey >> authorized_keys


      ##ON my DM8000 again...
      root@dm8000:~/.ssh# ssh -i mykey MYUSERNAME@server.incedo.org
      Last login: Tue Dec 28 19:03:14 2010 from pvr.incedo.org
      MYUSERNAME@server:~$



      Works from DM8000 with dropbear to a linux as well.... The obvious problem is that it seems there is no default keyname during key creation with dropbear. Therefor you have to actively specify it when you want to use it with "-i".

      Hope this helps....

      Regards
      /Per-Olov
    • RE: Rsync on 800HD SE newnigma2

      This worked. Using your guide and logging in with ssh -i (...) makes it possible to ssh from one dreambox to another without password.
      Too bad I have to actively specify which key to use. I had hoped that this wasn't necessary.

      Anyway. Thanks you very much for all your help.
      dm8000hd sssc, dm800hdse sc

      Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von alexbore ()

    • RE: Rsync on 800HD SE newnigma2

      Soo the story goes on :)

      Yesterday I put the line rsync stream tcp nowait root /usr/bin/rsync rsyncd --daemon into the file /etc/inetd.conf on my dm800hdse. My NAS can now successfully connect to my dm800hdse on port 873 using a username and password. At least something works.

      However I have a problem with sharing a folder on the dm800hdse to perform the sync job. As a test i wrote in both /share and /tmp as a Destination Path but I then get an error when I tryed to perform the sync on both which says:

      @ERROR: Unknown module 'tmp' (share)
      rsync error: error starting client-server protocol (code 5) at main.c(1803) [sender=3.0.6]

      From the log [Remote Replication] test failed: The destination folder path does not exist.

      I would imagine that there is something wrong in using the folder /tmp or /share. Do I need to "share" them out?
      Or isn't the rsync running on the dm800hdse box?
      dm8000hd sssc, dm800hdse sc

      Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von alexbore ()

    • RE: Rsync on 800HD SE newnigma2

      You can use rsync over ssh directly. This means the target server needs nothing except the public key from source. You do not need any rsync daemon and have good encryption, but to the cost of some overhead. This is preferred if you copy config files etc. But if you want to repeatedly copy huge DVD images I would first do some thinking regarding encryption and security risks as encryption has a CPU cost.

      If you want to sync from target back to source you could run like this on source...
      rsync -avH -e "ssh -c blowfish" --delete root@target.mydomain.com:/etc /backups/target.mydomain.com

      To instead copy from source to target u just switch the two last arguments (but still run command on source server). Also READ the man page of rsync. Especially for how trailing slashes "/" are handled and what they mean. If you have not used rsync, you really need to read this or you will break something.

      note:
      the user used must have enough privileges to access the files. root always can. But worth mention if you run as another user...

      hope this helps...

      /Per-Olov

      Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von pos42 ()