ssh localhost

The terminal app is limited in its rights for good reasons; to get rid of this you must SSH from outside (Wifi, USB) or inside the terminal app SSH to localhost. All this is only posible with RSA key authentication, not with password. Generate a key pair and use it to connect from the terminal to localhost as:

Generate a key pair just for use on the phone itself (without a passphrase):

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

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

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

Edit or create ~/.ssh/config and add the value for the private key to use:

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

Now you can:

$ ssh localhost

Last updated: Sat Oct 17 15:35:27 CEST 2015