What's new

SSH From Router To Node Doesn't Work When Started By services-start Script

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

HarryMuscle

Senior Member
I've got the following SSH line in my services-start script

Code:
sleep 300
DROPBEAR_PASSWORD="ssh_password" ssh -y -y -l "ssh_username" "192.168.1.2" "bash -s" < "node-script" &> /dev/null

which unfortunately keeps failing when it's run during the router boot process. However, if I SSH into the main router and manually invoke the script, the above line connects to the node without any issues. The only difference that I can think of between the two methods of how it's invoked is that during the boot process there is no display/terminal associated with the script and when run manually there is a display/terminal associated with it via the SSH session on the main router. However, I'm not sure how to actually get this fixed so that I can connect via SSH from the main router to a node via the services-start script.

Thanks,
Harry
 
Nevermind ... turns out the issue was that the working directory was different when run via the services-start script vs when run manually and the command I'm using was assuming that the node-script script is located in the working directory.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top