OpenWrt Forum Archive

Topic: how to enable ssh-agent to linksys router??

The content of this topic has been archived on 20 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I want to use ssh-agent at my desktop to login into Linksys router. but it seems not to work.

I generate the key, then copy it to the linksys router  .ssh/authorized_keys.
then run ssh-agent and ssh-add at my desktop
but it doesn't work...... everytime I have to input the password.

any advise? thanks a lot.

For logins using ssh keys permissions are very important to make it work. By default in WRT root's home directory is "/tmp". What I did is create a directory called "/root" and changed root's home directory to this (edit the /etc/passwd file). Put your DSA and/or RSA keys in "/root/.ssh/authorized_keys" and "chmod -R go= /root" on the WRT. It should now work.

It works!! thanks so much.
but I found that the copy rate to /root is only 30 KB/s, but to /tmp, the speed is above 300 KB/s!
I am somehow confused.

/tmp is in RAM while / (so is /root) is in flash

Yeah, for a couple of reasons you don't actually want to copy stuff to /root, copy it to /tmp. Unless of course you actually need it in /root, and need it to survive a reboot.

see,
Thanks a lot for the helps!!

thanx, worked for me with dsa keys and /tmp/.ssh/ directory

Another thing is to check ownership of /etc  it must be root.  On my system it had been set to uid = 1000 by, I think, installing the joe editor. Not sure why it wanted to do that.   i.e chown root:root /etc

olli_04 wrote:

There is also an howto at:

- DropbearPublicKeyAuthenticationHowto

OK, new question.  How can I get the wrt to scp out without suppling a password?  I have a script
to collect system data that I want to scp to my web server.

It seems like it should be easy enough:

http://openzaurus.org/wordpress/howto/passwordless-ssh/

I was not successful in getting it to work though. I guess it must be broken in RC3. I do this all the time between Linux/UNIX servers but not from my WRT for some reason.

Hi,
I'm using RC4 and was previously RC2 and the authorized_keys thing worked fine for 2 users on the wrt but since my upgrade I didn't managed to get it work neither for root (with an extra /root home dir) or another user on the router.

I tried all the chmod suggested in this thread and other howtos but with no luck.
I'm normally connecting using PuTTy from windows machines but also tried ssh from another windows machine.

Does anybody have an idea what I might do wrong. Maybe some general dropbear configuration?

The authorized_keys file is now stored in /etc/dropbear. And first of all you have to set a password with passwd to activate Dropbear's SSH server.

See the DropbearPublicKeyAuthenticationHowto Wiki page.

(Last edited by olli on 12 Jan 2006, 16:07)

Works perfectly again. After all it was that easy smile
Seems like I always overread the part that authorized_keys now goes to /etc/dropbear

Thank you for the quick and helpful response

The discussion might have continued from here.