Originally Posted by badbob001
Complete beginning to end instructions for usbnet are not available and one has to piece the needed steps from documentation and forum posts and mix in some experimentation. Not sure why it's not as well supported as the other hacks as this doesn't seem 'more linux' than usual. But here is how I got ssh over wifi working with auth keys in a Windows environment:
To connect with Putty for shell access:
- Install usbnet hack.
- Mount kindle and edit file \usbnet\etc\config
- Download and run puttygen: http://www.chiark.greenend.org.uk/~s.../download.html
- With (x) SSH-2 RSA selected, click Generate.
- Copy the text under 'Public key for pasting into OpenSSH authorized_keys file'.
Do not be tricked by: Conversions > Export OpenSSH Key.
- Paste into a new file named authorized_keys.
I previously thought authorized_keys was a folder to be created and placed my key file under that... wrong!
- If you plan to use the filezilla client for sftp, do not enter a key passphrase as that is not supported. Click Save Private Key to the local PC.
- Copy file authorized_keys to \usbnet\etc\
- Unmount kindle.
- Turn on WIFI. The kindle should obtain an IP address from your wireless access point. A quick way to find the kindle's IP is to go to Settings and then type 711. On a private WIFI network, set up a DHCP IP reservation so your kindle IP is always the same. Or just change your kindle wifi settings for a static ip address (the usbnet config file can not be used to set the WIFI ip address).
- On Kindle, type:
To connect with Filezilla client to transfer files:
- Configure your putty session to connect to the Kindle's IP over SSH. Under Connection > SSH > Auth > Private key file for authentication, choose the private key you saved locally.
- Connect to the kindle, enter username root, enter key passphrase if you used one, and you should be in. To save a step, you can set Connection > Data > Auto-login username: root.
- As you can tell from the login banner, if you need to change anything that is not in /mnt/us, then you will need to first mount the filesystem as RW (readwrite):
Once you're done, you should put the filesystem back to RO (readonly):
To connect with WinSCP client to transfer files:
- Edit > Settings > Connection > SFTP > Add keyfile, choose the private key you saved locally.
- Create a new connection entry with server type: SFTP, Logon Type: normal, User: root, and blank password.
- You can save some time by setting your Default Remote Directory to: /mnt/us to match the directory you see when mounting over usb.
- Unfortunately, filezilla doesn't support sending custom commands over sftp, which makes using it annoying. See WinSCP below for a better alternative.
- Create a new session filling in fields for 'Host name', User name (root), and Private Key File (WinSCP does not support private key passphrases).
- To add a custom command for refreshing the Kindle:
To invoke the command, either Files > Custom Commands > Refresh Kindle
- Preferences > Commands > Add...
- Description: Refresh Kindle
- Custom Command: dbus-send --system /default com.lab126.powerd.resuming int32:1
- (x) Remote command
- Select a Keyboard Shortcut if you like.
or Options > Toolbars > Custom Command Buttons or use the keyboard shortcut if defined.
Note that if you reboot your Kindle, the hack is disabled and you have to run the following commands again:
Alternatively, to have usbnet be enabled after a reboot, simply rename \usbnet\DISABLED_auto to auto and reboot.
Since you're using SSH over wifi instead of over usb, a setting of 'auto' is not so dangerous since you can still mount the kindle over usb to fix something. People using networking over usb can run into an issue where they change something on the kindle that prevents them from connecting over SSH, but since they have auto enabled, they can't mount the kindle to fix it.
FYI: if you keep the Kindle on usb (unmounted or charger), then the WIFI will stand on even when the screensaver kicks in.
I've tried this tutorial on my kindle with usbnetwork-0.28. It successfully connects with rndis adapter via usb and I was able to putty as well as filezilla into kindle with sshkey. However when I try to connect with wifi it fails to connect. I changed IPs in config file to match my network and I could only ping it. Both putty and filezilla can't access over wifi. Am I missing something here?