[Android Software Development] E:V:A:
Some Application Options

When you start the application you will see a list of different

configuration settings. The detailed description of each one is found

HERE. The most important being:

SSH Server Port Number (Default: [B]2222[/B])
Server Password (Default: [B]admin[/B])

Some Environment Variables

When you use SSHelper to login via SSH, you end up in the temporary

mksh shell at the home location set by the environment variable $ENV

which is set to be:

/data/data/com.arachnoid.sshelper/home

This behavior is contrary to what is normally used on Linux machines

where you end up in the $HOME directory. A few other important shell

variables are:

[SIZE=2]ENV=/data/data/com.arachnoid.sshelper/home[/SIZE]
[SIZE=2] HOME=/[/SIZE]
[SIZE=2] LD_LIBRARY_PATH=/vendor/lib:/system/lib[/SIZE]
[SIZE=2] LOGNAME=u0_a202[/SIZE]
[SIZE=2] LOOP_MOUNTPOINT=/mnt/obb[/SIZE]
[SIZE=2] PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin:/data/data/com.arachnoid.sshelper/bin[/SIZE]
[SIZE=2] SHELL=/tmp-mksh/tmp-mksh[/SIZE]
[SIZE=2] SSHELPER=/data/data/com.arachnoid.sshelper[/SIZE]
[SIZE=2] USER=u0_a202[/SIZE]

And to get the whole set, use the command "set":

[SIZE=2]ANDROID_ASSETS=/system/app[/SIZE]
[SIZE=2] ANDROID_BOOTLOGO=1[/SIZE]
[SIZE=2] ANDROID_DATA=/data[/SIZE]
[SIZE=2] ANDROID_PROPERTY_WORKSPACE=8,66560[/SIZE]
[SIZE=2] ANDROID_ROOT=/system[/SIZE]
[SIZE=2] ANDROID_SOCKET_zygote=10[/SIZE]
[SIZE=2] ANDROID_STORAGE=/storage[/SIZE]
[SIZE=2] ASEC_MOUNTPOINT=/mnt/asec[/SIZE]
[SIZE=2] BOARD=MSM8960[/SIZE]
[SIZE=2] BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/sec_edm.jar:/system/framework/seccamera.jar:/system/framework/scrollpause.jar:/system/framework/stayrotation.jar:/system/framework/smartfaceservice.jar:/system/framework/secocsp.jar:/system/framework/abt-persistence.jar:/system/framework/sc.jar[/SIZE]
[SIZE=2] COLUMNS=80[/SIZE]
[SIZE=2] EMULATED_STORAGE_SOURCE=/mnt/shell/emulated[/SIZE]
[SIZE=2] EMULATED_STORAGE_TARGET=/storage/emulated[/SIZE]
[SIZE=2] ENV=/data/data/com.arachnoid.sshelper/home[/SIZE]
[SIZE=2] EXTERNAL_STORAGE=/storage/emulated/legacy[/SIZE]
[SIZE=2] HOME=/[/SIZE]
[SIZE=2] IFS='[/SIZE]
[SIZE=2] '[/SIZE]
[SIZE=2] KSHEGID=0[/SIZE]
[SIZE=2] KSHGID=0[/SIZE]
[SIZE=2] KSHUID=0[/SIZE]
[SIZE=2] KSH_VERSION='@(#)MIRBSD KSH R40 2011/10/07'[/SIZE]
[SIZE=2] LD_LIBRARY_PATH=/vendor/lib:/system/lib[/SIZE]
[SIZE=2] LINES=24[/SIZE]
[SIZE=2] LOGNAME=u0_a202[/SIZE]
[SIZE=2] LOOP_MOUNTPOINT=/mnt/obb[/SIZE]
[SIZE=2] MAIL=/var/mail/u0_a202[/SIZE]
[SIZE=2] OPTIND=1[/SIZE]
[SIZE=2] PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin:/data/data/com.arachnoid.sshelper/bin[/SIZE]
[SIZE=2] PGRP=333[/SIZE]
[SIZE=2] PIPESTATUS[0]=0[/SIZE]
[SIZE=2] PIPESTATUS[1]=0[/SIZE]
[SIZE=2] PPID=21382[/SIZE]
[SIZE=2] PS1='$USER@$BOARD:$(basename $PWD) $( (($USER_ID)) && echo \$ || echo \#) '[/SIZE]
[SIZE=2] PS2='> '[/SIZE]
[SIZE=2] PS3='#? '[/SIZE]
[SIZE=2] PS4='+ '[/SIZE]
[SIZE=2] PWD=/data/data/com.arachnoid.sshelper/home[/SIZE]
[SIZE=2] RANDOM=20853[/SIZE]
[SIZE=2] SECONDARY_STORAGE=/storage/extSdCard:/storage/UsbDriveA:/storage/UsbDriveB:/storage/UsbDriveC:/storage/UsbDriveD:/storage/UsbDriveE:/storage/UsbDriveF[/SIZE]
[SIZE=2] SECONDS=20[/SIZE]
[SIZE=2] SHELL=/tmp-mksh/tmp-mksh[/SIZE]
[SIZE=2] SSHELPER=/data/data/com.arachnoid.sshelper[/SIZE]
[SIZE=2] SSH_CLIENT='192.168.xx.xx 14115 2222'[/SIZE]
[SIZE=2] SSH_CONNECTION='192.168.xx.xx 14115 192.168.yy.yy 2222'[/SIZE]
[SIZE=2] TMOUT=0[/SIZE]
[SIZE=2] TZ=GMT-3[/SIZE]
[SIZE=2] USER=u0_a202[/SIZE]
[SIZE=2] USER_ID=0[/SIZE]
[SIZE=2] VIBE_PIPE_PATH=/dev/pipes[/SIZE]
[SIZE=2] _=set[/SIZE]

(These may vary somewhat, depending on your device.)

The default profile and sshd_config

profile:

[SIZE=2]# place user customizations here[/SIZE]
[SIZE=2] uname -s -r -m[/SIZE]
[SIZE=2] alias ls="$SSHELPER/bin/ls"[/SIZE]
[SIZE=2] export PS1='$USER@$BOARD:$(basename $PWD) $( (($USER_ID)) && echo \$ || echo \#) '[/SIZE]

If you are rooted and already have Busybox installed, it is highly

recommended to edit this file.

sshd_config:

[SIZE=2]# $OpenBSD: sshd_config,v 1.87 2012/07/10 02:19:15 djm Exp $[/SIZE]

[SIZE=2] # This is the sshd server system-wide configuration file. See[/SIZE]
[SIZE=2] # sshd_config(5) for more information.[/SIZE]

[SIZE=2] # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin[/SIZE]

[SIZE=2] # The strategy used for options in the default sshd_config shipped with[/SIZE]
[SIZE=2] # OpenSSH is to specify options with their default value where[/SIZE]
[SIZE=2] # possible, but leave them commented. Uncommented options override the[/SIZE]
[SIZE=2] # default value.[/SIZE]

[SIZE=2] #Port 22[/SIZE]
[SIZE=2] #AddressFamily any[/SIZE]
[SIZE=2] #ListenAddress 0.0.0.0[/SIZE]
[SIZE=2] #ListenAddress ::[/SIZE]

[SIZE=2] # The default requires explicit activation of protocol 1[/SIZE]
[SIZE=2] #Protocol 2[/SIZE]

[SIZE=2] # HostKey for protocol version 1[/SIZE]
[SIZE=2] #HostKey /etc/ssh/ssh_host_key[/SIZE]
[SIZE=2] # HostKeys for protocol version 2[/SIZE]
[SIZE=2] HostKey /data/data/com.arachnoid.sshelper/home/.ssh/id_rsa[/SIZE]
[SIZE=2] HostKey /data/data/com.arachnoid.sshelper/home/.ssh/id_dsa[/SIZE]
[SIZE=2] HostKey /data/data/com.arachnoid.sshelper/home/.ssh/id_ecdsa[/SIZE]

[SIZE=2] # Lifetime and size of ephemeral version 1 server key[/SIZE]
[SIZE=2] #KeyRegenerationInterval 1h[/SIZE]
[SIZE=2] #ServerKeyBits 1024[/SIZE]

[SIZE=2] # Logging[/SIZE]
[SIZE=2] # obsoletes QuietMode and FascistLogging[/SIZE]
[SIZE=2] #SyslogFacility AUTH[/SIZE]
[SIZE=2] #LogLevel INFO[/SIZE]

[SIZE=2] # Authentication:[/SIZE]

[SIZE=2] #LoginGraceTime 2m[/SIZE]
[SIZE=2] #PermitRootLogin yes[/SIZE]
[SIZE=2] #StrictModes yes[/SIZE]
[SIZE=2] #MaxAuthTries 6[/SIZE]
[SIZE=2] #MaxSessions 10[/SIZE]

[SIZE=2] #RSAAuthentication yes[/SIZE]
[SIZE=2] #PubkeyAuthentication yes[/SIZE]

[SIZE=2] # The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2[/SIZE]
[SIZE=2] # but this is overridden so installations will only check .ssh/authorized_keys[/SIZE]

[SIZE=2] # AuthorizedKeysFile (path)[/SIZE]

[SIZE=2] #AuthorizedPrincipalsFile none[/SIZE]

[SIZE=2] # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts[/SIZE]
[SIZE=2] #RhostsRSAAuthentication no[/SIZE]
[SIZE=2] # similar for protocol version 2[/SIZE]
[SIZE=2] # HostbasedAuthentication no[/SIZE]
[SIZE=2] # Change to yes if you don't trust ~/.ssh/known_hosts for[/SIZE]
[SIZE=2] # RhostsRSAAuthentication and HostbasedAuthentication[/SIZE]
[SIZE=2] # IgnoreUserKnownHosts no[/SIZE]
[SIZE=2] # Don't read the user's ~/.rhosts and ~/.shosts files[/SIZE]
[SIZE=2] #IgnoreRhosts yes[/SIZE]

[SIZE=2] # To disable tunneled clear text passwords, change to no here![/SIZE]
[SIZE=2] # PasswordAuthentication no[/SIZE]
[SIZE=2] # PermitEmptyPasswords yes[/SIZE]

[SIZE=2] # Change to no to disable s/key passwords[/SIZE]
[SIZE=2] #ChallengeResponseAuthentication yes[/SIZE]

[SIZE=2] # Kerberos options[/SIZE]
[SIZE=2] #KerberosAuthentication no[/SIZE]
[SIZE=2] #KerberosOrLocalPasswd yes[/SIZE]
[SIZE=2] #KerberosTicketCleanup yes[/SIZE]
[SIZE=2] #KerberosGetAFSToken no[/SIZE]

[SIZE=2] # GSSAPI options[/SIZE]
[SIZE=2] #GSSAPIAuthentication no[/SIZE]
[SIZE=2] #GSSAPICleanupCredentials yes[/SIZE]

[SIZE=2] # Set this to 'yes' to enable support for the deprecated 'gssapi' authentication[/SIZE]
[SIZE=2] # mechanism to OpenSSH 3.8p1. The newer 'gssapi-with-mic' mechanism is included[/SIZE]
[SIZE=2] # in this release. The use of 'gssapi' is deprecated due to the presence of[/SIZE]
[SIZE=2] # potential man-in-the-middle attacks, which 'gssapi-with-mic' is not susceptible to.[/SIZE]
[SIZE=2] #GSSAPIEnableMITMAttack no[/SIZE]

[SIZE=2] # Set this to 'yes' to enable PAM authentication, account processing,[/SIZE]
[SIZE=2] # and session processing. If this is enabled, PAM authentication will[/SIZE]
[SIZE=2] # be allowed through the ChallengeResponseAuthentication and[/SIZE]
[SIZE=2] # PasswordAuthentication. Depending on your PAM configuration,[/SIZE]
[SIZE=2] # PAM authentication via ChallengeResponseAuthentication may bypass[/SIZE]
[SIZE=2] # the setting of "PermitRootLogin without-password".[/SIZE]
[SIZE=2] # If you just want the PAM account and session checks to run without[/SIZE]
[SIZE=2] # PAM authentication, then enable this but set PasswordAuthentication[/SIZE]
[SIZE=2] # and ChallengeResponseAuthentication to 'no'.[/SIZE]
[SIZE=2] # UsePAM no[/SIZE]

[SIZE=2] # AllowAgentForwarding yes # default[/SIZE]
[SIZE=2] # AllowTcpForwarding yes # default[/SIZE]
[SIZE=2] #GatewayPorts no[/SIZE]
[SIZE=2] #X11Forwarding yes[/SIZE]
[SIZE=2] #X11DisplayOffset 10[/SIZE]
[SIZE=2] #X11UseLocalhost yes[/SIZE]
[SIZE=2] #PrintMotd yes[/SIZE]
[SIZE=2] PrintLastLog no[/SIZE]
[SIZE=2] #TCPKeepAlive yes[/SIZE]
[SIZE=2] #UseLogin no[/SIZE]
[SIZE=2] UsePrivilegeSeparation no[/SIZE]
[SIZE=2] PermitUserEnvironment yes # allow ~/.ssh/environment to contain useful path and envs for logins[/SIZE]
[SIZE=2] Compression yes[/SIZE]
[SIZE=2] ClientAliveInterval 300 # 300 seconds of idle time[/SIZE]
[SIZE=2] ClientAliveCountMax 5 # after five queries, disconnect[/SIZE]
[SIZE=2] UseDNS no[/SIZE]
[SIZE=2] # PidFile[/SIZE]
[SIZE=2] #MaxStartups 10[/SIZE]
[SIZE=2] #PermitTunnel no[/SIZE]
[SIZE=2] #ChrootDirectory[/SIZE]
[SIZE=2] #VersionAddendum none[/SIZE]

[SIZE=2] # no default banner path[/SIZE]
[SIZE=2] #Banner none[/SIZE]

[SIZE=2] # override default of no subsystems[/SIZE]
[SIZE=2] Subsystem sftp internal-sftp[/SIZE]

[SIZE=2] # This enables accepting locale enviroment variables LC_* LANG, see sshd_config(5).[/SIZE]
[SIZE=2] AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES[/SIZE]
[SIZE=2] AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT[/SIZE]
[SIZE=2] AcceptEnv LC_IDENTIFICATION LC_ALL[/SIZE]

[SIZE=2] # Example of overriding settings on a per-user basis[/SIZE]
[SIZE=2] #Match User anoncvs[/SIZE]
[SIZE=2] # X11Forwarding no[/SIZE]
[SIZE=2] # AllowTcpForwarding no[/SIZE]
[SIZE=2] # ForceCommand cvs server[/SIZE]

[SIZE=2] #Match LocalAddress 127.0.0.1[/SIZE]
[SIZE=2] # X11Forwarding yes[/SIZE]
[SIZE=2] # AllowTcpForwarding yes[/SIZE]
[SIZE=2] # AllowUsers sshelper[/SIZE]