Remote Shell Script to Reboot

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
milty456
DD-WRT Novice


Joined: 26 Aug 2011
Posts: 43

PostPosted: Mon Feb 06, 2017 16:26    Post subject: Remote Shell Script to Reboot Reply with quote
Is there a way to have a shell script in Linux to remotely reboot the router?

If anyone can share some examples that would be appreciated.

Thanks
Sponsor
milty456
DD-WRT Novice


Joined: 26 Aug 2011
Posts: 43

PostPosted: Mon Feb 06, 2017 20:51    Post subject: Ubuntu Reply with quote
Thanks

I gen'ed a public key with puttygen.
Now, in ubuntu, what do i do with that file so that when i ssh it gets used?
milty456
DD-WRT Novice


Joined: 26 Aug 2011
Posts: 43

PostPosted: Tue Feb 07, 2017 20:10    Post subject: Well Reply with quote
You don't "Have" to lol...but it's appreciated.

This doesn't make much sense.

The router is the host so doing this won't work as there is no transferring "files" to the router I assume.

Also, messing with key files scares the crap out of me to the point I'm afraid I will lock myself out of my system...it runs my entire automation system.

I'm going to spin up an ubuntu VM and mess around some more.
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6580
Location: Romerike, Norway

PostPosted: Tue Feb 07, 2017 20:23    Post subject: Reply with quote
After the keys are generated, take the public key and paste into the dd-wrt router's Services->Services->Authorized Keys field.
milty456
DD-WRT Novice


Joined: 26 Aug 2011
Posts: 43

PostPosted: Mon Mar 06, 2017 2:13    Post subject: Still not working Reply with quote
I'm afraid that link details how to generate keys to get into the linux box. I want to get into the router from linux.

I used putty gen to generate a public and private key.
I put the public key in ddwrt.

Now, what do i do with the private key...keeping in mind i don't want that key to apply to the linux machine(i don't want to have to use that key to ssh into that linux machine; i simply want the key pairs to be put in place so i can run comments from the linux machine to ddwrt without a password.

Everything i look at says be careful importing the private key...you could lock yourself out, etc. I'm trying to avoid that.

Thanks
milty456
DD-WRT Novice


Joined: 26 Aug 2011
Posts: 43

PostPosted: Mon Mar 06, 2017 20:07    Post subject: Script Reply with quote
Maybe even easier...is there a script i could run that
every 30 mins the router can ping a website and if it gets nothing back, reboot the router?
milty456
DD-WRT Novice


Joined: 26 Aug 2011
Posts: 43

PostPosted: Mon Mar 06, 2017 20:18    Post subject: Ty! Reply with quote
TY kindly. I shall look into this.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum