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:
- 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:
INFO: One issue you'll face is that after transferring files over, the Kindle doesn't know to refresh its index as it does when you unmount from usb. Alt-Z will usually show updates in the Pictures folder but does nothing for Documents. From a ssh connection, you can run the following to trigger a refresh: "dbus-send --system /default com.lab126.powerd.resuming int32:1". If you mix this command with Alt-Z, you may get duplicates so just stick to the command. Also for some reason, new documents may show up but not shown as the newest, so sort by title to find them.
To connect with Putty for shell access:
INFO: If you just installed an usbnet update and can no longer SSH to your Kindle over WIFI even though you can ping it, you should restart the Kindle. This may happen if your Kindle restarts from an update with the usb cable attached.
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.
INFO: if you keep the Kindle on usb (unmounted or charger), then the WIFI will stay on even when the screensaver kicks in.