Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I'm running CyanogenMod 7 and I'd like to enable passwordless SSH login to my main Linux computer on my network, but only when the phone is accessing the server over the same network. How/where should I put my .ssh/known_hosts file to enable this?

share|improve this question
    
What app are you using for SSH, and does it even support this? –  Matthew Read Feb 10 '11 at 2:30
    
I'm using the SSH that is shipped with CyanogenMod, I wrote a script in Bash which will connect me to my server (ie ssh -p 1024 rfkrocktk@work-laptop), and I simply execute that. The SSH implementation is Dropbear client v0.52. –  Naftuli Tzvi Kay Feb 10 '11 at 2:48
add comment

1 Answer 1

up vote 2 down vote accepted

Try this:

  1. Take/generate a public key of your Android device. Don't you ever hardcode your password into scripts :)

  2. Put it into .ssh/authorized_keys on main computer

  3. Then use "from=" mask to limit IP/hostname to your LAN, like from="192.168.1.*".

If IP range won't work, set up a fixed hostname for MAC address of your device on WLAN. Some AP firmwares, like OpenWRT, allow it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.