This should be possible with a Kindle. The basic Kindle costs $50 or so. And it is a fork of Android. And has a month of battery life. There are some Kindle-roots [Search "root a kindle"]. Would something like this work for you? The keyboard will still be the kindle-keyboard.
The other option is a cheap ipad with a bluetooth keyboard. If you turn off all the unnecessary apps and notifications and put it on airplane mode - it should last a couple of weeks. You turn it on only when you need it. You will still need to get an ssh app [many available].
The other option is a cheap ipad with a bluetooth keyboard. If you turn off all the unnecessary apps and notifications and put it on airplane mode - it should last a couple of weeks. You turn it on only when you need it. You will still need to get an ssh app [many available].