HOW TO USE SSH/SCP WITHOUT USER INPUT (LOGIN/PASSWORD), F.I. IN A BASH/SH SCRIPT OR FROM THE COMMAND LINE... ============================================================================================================ I explain it below and hope it helps ya. First automatic login with SSH (to a remote machine) is explained, followed by automatic file transfer with SCP (Secure CoPy) and finally a Personal Use and a short note to those who helped me (CREDITS) A. SSH: === - needed ssh-keygen: apt-get install openssh-keygen - or installing it (when necessary) within a script: if [ $(type apt-get > /dev/null 2>&1 ; echo $?) -eq 0 ]; then [ $(type openssh-keygen > /dev/null 2>&1 ; echo $?) -ne 0 ] && apt-get install -y openssh-keygen > /dev/null 2>&1 fi openssh-keygen will create 2 files at your localhost: id_rsa and id_rsa.pub. The 1st one (id_rsa) is a private key (use it ALWAYS as PRIVATE, do not it give it away!) and the other one is the public key (id_rsa.pub). id_rsa is normally placed in: ~/.ssh at your localhost the content of id_rsa_pub should be added to the file authorized_keys at your remote machine/dreambox in ~/.ssh Further the permissions (of the Directories and the Files) are very important: LOCAL machine: chmod go-w ~/. chmod 700 ~/.ssh chmod 600 ~/.ssh/id_rsa chmod 644 ~/.ssh/id_rsa.pub REMOTE machine: chmod go-w ~/. chmod 700 ~/.ssh chmod 644 ~/.ssh/authorized_keys Normally you should use the file/command "ssh-copy-id -i ~/.ssh/id_rsa.pub " to add/copy the content of id_rsa.pub to the file authorized_keys at your remote machine. However at dreamboxes this is not working. Therefor: copy and paste the content of the file id_rsa.pub at your local machine to the file ~/.ssh/authorized_keys at your remote machine. If authorized_keys at your remote machine already exists, just append it (add it to the end of the file). Then, another issue (assuming the ip of your remote machine is: 192.168.1.10): normally you can login to your remote machine without entering login and password with f.i.: ssh -y -i ~/.ssh/id_rsa root@192.168.1.10 'uname -n' That ("uname -n") should give you the hostname of the remote machine. HOWEVER, this is NOT WORKING at dreamboxes. Reason: unfortunately dreambox does use dropbear with an incompatible key_Format. You can bypass this, by: 1. converting the id_rsa with "dropbearconvert" to a file with the right key-Format by entering once: dropbearconvert openssh dropbear /root/.ssh/id_rsa /root/.ssh/id_dropbear as you can see, in stead of "id_rsa" now is used: "id_dropbear". 2 the ssh command above will then be: ssh -y -i ~/.ssh/id_dropbear root@192.168.1.10 'uname -n' B. SCP: === SCP is (in fact) a symbolic link to /usr/sbin/dropbearmulti, therefor you can use the dropbearkey, f.i. when you want to UPLOAD the file "scp_test.txt" to "192.168.1.10:/tmp/test.txt": scp -i ~/.ssh/id_dropbear scp_test.txt root@192.168.1.10:/tmp/test.txt However, since dropbear uses as default key ~/.ssh/id_dropbear, you do NOT have to mention that key in your command: scp -i scp_test.txt root@192.168.1.10:/tmp/test.txt To DOWNLOAD files from remote machine to local machine without entering login/password can be down with the command: scp -i root@192.168.1.10:/etc/enigma2/bouquets.tv /tmp/my_bouquets.tv Then from remote machine the file /etc/enigma2/bouquets.tv will be copied to the local machine as: my_bouquets.tv and placed in the directory/folder /tmp C. PERSONAL USE: ============ I use it (ssh/scp) for copying/adding/editing/changing my (user)bouquets files at my notebook and when done I upload them to my remote machines (dreamboxes). When done I do not have to restart E2/GUI at my remote machines, because I do that with a ssh command: ssh -y -i ~/.ssh/id_dropbear root@$192.168.1.10 'wget -qO - "http://127.0.0.1/web/servicelistreload?mode=2" >/dev/null' NOTE FYI: - you can use these SSH and SCP commands in your (ba)sh script. Also, you can in your script "transfer" a local variable from the remote machine back to the script; - for instance, if you want to know if the directory "/etc/enigma2" exists at your remote machine, the variables will normally "stay" (of course) at your remote machine, because you are in a SSH "environment"! However with the following commands, you can "transfer" it back (and thus use it) in your script: ip="192.168.1.10" DIR_EXIST=0 DIR_EXIST=$(ssh -y -i ~/.ssh/id_dropbear root@$ip "[[ -d ${DIR_BOUQUETS} ]] && DIR=1 && echo \$DIR") [[ ${ DIR_EXIST} = 0 ]] && echo "...${DIR_BOUQUETS} not found at ${ip}" Credits: I did not find it out myself, but got help from users "Klix" and "Fred Bogus Trumper. The thread can be read here: http://dreambox.de/board/index.php?thread/24062-sshpass-bzw-im-skript-autom-remote-einloggen/ Lot of thanks to those both users ! BR, Ni Hao (2018)