What's new

Passwordless SSH into the Asus Router

  • 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!

tonysamson

Regular Contributor
So I managed to SSH into the router from my My Book Live without entering my router's password. But, if I'd reboot my router I'm back to square one and would have to enter my password again.

I noticed that the authorized_keys file located in /root/.ssh gets deleted everytime the router is rebooted.

I tried placing the .ssh folder with the authorized_keys file somewhere and mount it using /etc/fstab but I think the fstab file gets deleted as well so it doesn't get mounted.

Please help me find a way to get around it. How do I make the .ssh folder and the authorized_keys file become permanent?

Thank you so much.
 
On the Administration-System page there is a field labeled "SSH Authentication key". Paste your authorized keys into this field. The keys will then survive reboot.
 
Neat. I also found out on a Linux system you can use
Code:
ssh-copy-id target
where "target" consists of your_user_name@router_IP_address.

It will ask for your password and write it into the router's authorized_keys file.

Of course you have to generate your key first with
Code:
ssh-keygen

http://serverfault.com/questions/277774/how-to-export-my-sshs-public-key
 
On the Administration-System page there is a field labeled "SSH Authentication key". Paste your authorized keys into this field. The keys will then survive reboot.

Bumping this thread just to ask:

I'm supposed to paste my public key for the machine I'm trying to connect from, right?

So the following text:

---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20160101"
[KEY]
---- END SSH2 PUBLIC KEY ----

It's been a while since I've used authentication and I've basically forgotten everything :confused:
 

Latest threads

Sign Up For SNBForums Daily Digest

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