← Back to team overview

ubuntu-phone team mailing list archive

ssh localhost to get an unrestricted shell, was: Re: Running a Debian chroot on Ubuntu Phone MUA mutt

 

Hi

On Fri 17-Apr-2015 at 04:49:49PM +0200, Oliver Grawert wrote:
> 
> one option would be "ssh localhost" ;) but that requires you to have
> your secret key on teh phone, not sure that is desirable ;)

You can generate a key pair just for use on the phone itself (without a
passphrase if you want):

  cd ~/.ssh
  ssh-keygen -t rsa -f localhost_rsa
  cat localhost_rsa.pub >> authorized_keys

Then edit ~/.ssh/authorized_keys and add this to the start of the last
line:

  from="127.0.0.1" ssh-rsa AAAA...

Then edit / create ~/.ssh/config and add:

  Host localhost
    Hostname 127.0.0.1
    IdentityFile /home/phablet/.ssh/localhost_rsa

Then you can:

  ssh localhost

I think this avoids any concerns you might have about having your secret
key for other systems on the phone -- this key pair doesn't need to be
used for anything else.

All the best

Chris

-- 
Webarchitects Co-operative
http://webarchitects.coop/
+44 114 276 9709
@webarchcoop


References