Editing code on Android using Atom on PC (tomwhore)

2 points by lucasgonze ↗ HN
(From some hacking by https://keybase.io/tomhiggins)

On your AndroidOS device

  Install Termux (https://termux.com/)

  Launch Termux

  Type these commands 

     > apt install openssh

     > touch ~/.ssh/authorized_keys 

     > chmod 600 ~/.ssh/authorized_keys

     > chmod 700 ~/.ssh

     > ssh-keygen

     > cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

     > chmod 600 ~/.ssh/authorized_keys

     > sshd

     > scp ~/.ssh/id_rsa name@remotehost.com:/path/of/id_rsa

To SSH into Android from the Remote Host

   Type this command from within a Terminal

      > ssh -p 8022 -i /path/of/id_rsa IPofYourAndroid 

To SFTP into Android from the Remote Host

    Type this command from within a Terminal

      > sftp -P 8022 -i /path/of/id_rsa IPofYourAndroid  

     
To Mount to the Termux Directories On the Remote Host Device

   Make sure you have SSHFS installed 

   Type this command

      >sshfs anything@IPofYourAndroid:/data/data/com.termux/files/home/ /path/on/remote/to/mount/ -p 8022 -o IdentityFile=/path/of/id_rsa

   Once Mounted you can access the files and directoris on the Android device from 

   any app/program (example, file managers, Atom editor, Libre Office, etc etc)

Links to sources:

SSH Under Termux - https://oliverse.ch/tech/2015/11/06/run-an-ssh-server-on-your-android-with-termux.html

Termux Help - https://termux.com/help.html

1 comment

[ 3.4 ms ] story [ 14.0 ms ] thread
ecdsa keys are, I believe, faster and more secure. To use them, replace "rsa" with "ecdsa" wherever it occurs, and ssh-keygen with "ssh-keygen -t ecdsa"