[GH-ISSUE #6] sshsrv on Android ? (With Termux ?) #4

Closed
opened 2026-02-26 17:45:08 +03:00 by kerem · 3 comments
Owner

Originally created by @axoroll7 on GitHub (Dec 30, 2022).
Original GitHub issue: https://github.com/Crosse/sshsrv/issues/6

Hello,

I was able to install this program on Android. But the installation, without tutorial, take me some time to be completed. Maybe you could add instructions for Android, for people who do not know how to do it ?

My steps :

  • I installed F-Droid.
  • I installed Termux through F-Droid.
  • In Termux, I installed golang : pkg install golang.
  • I installed this package through golang : go install github.com/Crosse/sshsrv@latest.
  • I restarted Termux, but sshsrv was not in the PATH. I tested this command : "$(go env GOPATH)/bin/sshsrv", and it worked, showing the package was correctly installed.
  • I utilized this command (written by myself) to add golang packages in the PATH : printf "\n\n#begin golang\nexport GOPATH=\"\$(go env GOPATH)\"\nexport PATH=\"\$PATH:\$GOPATH/bin\"\n#end golang\n\n" >> ~/.bashrc, and sshsrv was effectively added to the PATH. I was able to use sshsrv in Termux.
  • Bonus : With Termux-tasker, MacroDroid, and the configuration files of OpenSSH, I was able to create a shortcut on my homescreen to start a ssh session with the desired server, without prompt.

In my opinion, many developers would feel safer knowing they can access their server with their mobile. Maybe, adding these steps in a separate wiki, or in the README, could help some people.

Originally created by @axoroll7 on GitHub (Dec 30, 2022). Original GitHub issue: https://github.com/Crosse/sshsrv/issues/6 Hello, I was able to install this program on Android. But the installation, without tutorial, take me some time to be completed. Maybe you could add instructions for Android, for people who do not know how to do it ? My steps : * I installed F-Droid. * I installed Termux through F-Droid. * In Termux, I installed golang : ```pkg install golang```. * I installed this package through golang : ```go install github.com/Crosse/sshsrv@latest```. * I restarted Termux, but sshsrv was not in the PATH. I tested this command : ```"$(go env GOPATH)/bin/sshsrv"```, and it worked, showing the package was correctly installed. * I utilized this command (written by myself) to add golang packages in the PATH : ```printf "\n\n#begin golang\nexport GOPATH=\"\$(go env GOPATH)\"\nexport PATH=\"\$PATH:\$GOPATH/bin\"\n#end golang\n\n" >> ~/.bashrc```, and sshsrv was effectively added to the PATH. I was able to use sshsrv in Termux. * Bonus : With Termux-tasker, MacroDroid, and the configuration files of OpenSSH, I was able to create a shortcut on my homescreen to start a ssh session with the desired server, without prompt. In my opinion, many developers would feel safer knowing they can access their server with their mobile. Maybe, adding these steps in a separate wiki, or in the README, could help some people.
kerem closed this issue 2026-02-26 17:45:08 +03:00
Author
Owner

@Crosse commented on GitHub (Jan 4, 2023):

I don't know a lot about the Android platform, but if the uname command reports that it's arm64, could you try installing the binary from the releases page? The direct link to the arm64 version is here. I have no idea if it'll work, but it's worth a shot.

Thanks for all the info! I'll see about incorporating it into the README somehow.

<!-- gh-comment-id:1371427325 --> @Crosse commented on GitHub (Jan 4, 2023): I don't know a lot about the Android platform, but if the `uname` command reports that it's arm64, could you try installing the binary from the [releases page](https://github.com/Crosse/sshsrv/releases/tag/v1.0)? The direct link to the arm64 version is [here](https://github.com/Crosse/sshsrv/releases/download/v1.0/sshsrv-linux-arm64.zip). I have no idea if it'll work, but it's worth a shot. Thanks for all the info! I'll see about incorporating it into the README somehow.
Author
Owner

@axoroll7 commented on GitHub (Jan 5, 2023):

You are right, it worked. The script :

VERSION=1.0
OS=linux
ARCH=arm64
wget -qO- https://github.com/Crosse/sshsrv/releases/download/v$VERSION/sshsrv-$OS-$ARCH.zip | zcat | install -D /dev/stdin /data/data/com.termux/files/opt/sshsrv/bin/sshsrv &&
ln -s /data/data/com.termux/files/opt/sshsrv/bin/sshsrv /data/data/com.termux/files/usr/bin/sshsrv &&
echo $VERSION-$OS-$ARCH > /data/data/com.termux/files/opt/sshsrv/version
hash -r

EDIT : The command "install" does what "mkdir -p" and "chmod +x" do. "zcat" decompresses the first file in the zip file. "ln" create a symlink, to put the executable in the PATH. "hash -r" refreshes the PATH.

<!-- gh-comment-id:1372690666 --> @axoroll7 commented on GitHub (Jan 5, 2023): You are right, it worked. The script : ``` VERSION=1.0 OS=linux ARCH=arm64 wget -qO- https://github.com/Crosse/sshsrv/releases/download/v$VERSION/sshsrv-$OS-$ARCH.zip | zcat | install -D /dev/stdin /data/data/com.termux/files/opt/sshsrv/bin/sshsrv && ln -s /data/data/com.termux/files/opt/sshsrv/bin/sshsrv /data/data/com.termux/files/usr/bin/sshsrv && echo $VERSION-$OS-$ARCH > /data/data/com.termux/files/opt/sshsrv/version hash -r ``` EDIT : The command "install" does what "mkdir -p" and "chmod +x" do. "zcat" decompresses the first file in the zip file. "ln" create a symlink, to put the executable in the PATH. "hash -r" refreshes the PATH.
Author
Owner

@axoroll7 commented on GitHub (Feb 28, 2023):

I think the issue is completed. Thank you for your help !

<!-- gh-comment-id:1447704773 --> @axoroll7 commented on GitHub (Feb 28, 2023): I think the issue is completed. Thank you for your help !
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/sshsrv#4
No description provided.