i have 2 scripts
/bin/ash /root/scp.sh &
/usr/bin/sshpass -e scp /tmp/rmm_nr_own_report email@example.com:/tmp/neighbors/rmm_own_report$HOSTNAME
if i start from console /root/start.sh all works fine it sends file to remote host
but if i add to init.d and rc.d i see that start.sh started then scp.sh started but it stacking on
sshpass -e scp /tmp/rmm_nr_own_report
i dont even know how to check because when i start start.sh from console it works
and the command should be executed only after actually the network works, if not it will fail...
can you try creating some ssh keys and using the preshared keys method?
no i cant
the size of it 1.34Mb and i use 8 Mb flash routers
but it is really triki why doesnt it works when i started it via script which started by system in background
i know there is way to try with preshared keys but why sshpass dont work when it started by system
they are both the same OpenWrt routers same firware 22.05.03
do you have any NAS or another pc/server always on?
A -> C
B -> C
in this topic
[Why I can't run ssh tunnel on startup?]
Thanks guys for your help. I came to solution! First, I executed from rc.local "yes | ssh...." and looked what changed. Ssh created /.ssh/known_hosts on the device (yeah, indeed in the / folder). For
but what exactly he did
yes answers "y" to another program (
ssh) prompt "Do you want to continue connecting? (y/n) "
but i use scp and sshpass and looks like there is no yes option
when i run the comnad in console with -vvvv i see
root@AP2:~# /usr/bin/sshpass -vvvv -p '1' scp -P 22 /tmp/rmm_nr_own_report firstname.lastname@example.org:/tmp/neighbors/rmm_own_report$HOSTNAME /usr/bin/sshpass -vvvv -p '1' scp -P 22 /tmp/rmm_nr_own_report root
@192.168.222.1:/tmp/neighbors/rmm_own_report$HOSTNAME >> /tmp/mylogifile.log>> /tmp/mylogifile.log
SSHPASS: searching for password prompt using match "assword"
SSHPASS: read: email@example.com's password:
SSHPASS: detected prompt. Sending password.
but how i will see the output with -vvvv when it is started by rc.d ?
i tried like this but mylogifile is empty
/usr/bin/sshpass -vvvv -p '1' scp -P 22 /tmp/rmm_nr_own_report firstname.lastname@example.org:/tmp/neighbors/rmm_own_report$HOSTNAME >> /tmp/mylogifile.log
Read the next message in that topic.
You need to replace
>> /tmp/mylogifile with
yeah well it asks for confirmation
Host '192.168.222.1' is not in the trusted hosts file.
(ssh-ed25519 fingerprint SHA256:FpB893tBVdJRX63XR4vBS4yOLqAEdgN31Rhs2zm25wM)
Do you want to continue connecting? (y/n)
but where do i put that confirmation if i use scp and sshpass and sshpass does not have yes option
Connect once manually so it gets added in the trusted hosts file.
why not extract passwords from:
Usage: dropbearkey -t <type> -f <filename> [-s bits]
-t type Type of key to generate. One of:
-f filename Use filename for the secret key.
~/.ssh/id_dropbear is recommended for client keys.
-s bits Key size in bits, should be a multiple of 8 (optional)
Ed25519 has a fixed size of 256 bits
-y Just print the publickey and fingerprint for the
private key in <filename>.
dropbearkey -f /etc/dropbear/dropbear_rsa_host_key -y
and add them to allowed hosts?
no it wont as i learned today when executing from rc.d it has it is own trustet list
/.ssh/known_hosts and see if it helps.
i dont have .ssh in my root folder
root@AP2:~# ls /root/
Candidates KIKALOG dummies kicker.sh mykikaconsole.sh neigborsguest neighbors setupmykika061