Termux-app: Error while installing openssh

Created on 5 Jul 2017  路  11Comments  路  Source: termux/termux-app

apt install openssh fails with

CANNOT LINK EXECUTABLE "ssh-keygen": cannot locate symbol "OpenSSL_add_all_algorithms" referenced by "/system/bin/ssh-keygen"...
Aborted 
CANNOT LINK EXECUTABLE "ssh-keygen": cannot locate symbol "OpenSSL_add_all_algorithms" referenced by "/system/bin/ssh-keygen"...
Aborted 
CANNOT LINK EXECUTABLE "ssh-keygen": cannot locate symbol "OpenSSL_add_all_algorithms" referenced by "/system/bin/ssh-keygen"...
Aborted 
CANNOT LINK EXECUTABLE "ssh-keygen": cannot locate symbol "OpenSSL_add_all_algorithms" referenced by "/system/bin/ssh-keygen"...
Aborted 

Most helpful comment

@azulkipli You need to copy the content of id_rsa.pub from your computer and add it to the device's ~/.ssh/authorized_keys

All 11 comments

Did you do something weird with your path. What is the output of echo $PATH?

From adb shell

athene:/ # echo $PATH
/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin:/data/data/com.termux/files/usr/bin

The problem seems to be that you have /system/bin in your path, so you're using the wrong ssh-keygen.
Try resetting your path to the default in termux.

That fixed it. Thanks for the help @Neo-Oli

I have created authorized hosts file with ssh keys. However ssh is failing is it is not able to find keys.

adb shell 'echo $HOME'
/
130|athene:/ # ls -la .ssh
total 4
drwx------  2 root root   0 2017-07-05 16:14 .
drwxr-xr-x 22 root root   0 2017-07-05 14:36 ..
-rw-r--r--  1 root root 395 2017-07-05 16:14 authorized_keys
athene:/ # logcat -s 'syslog:*'                                                                                                                      
07-05 16:35:56.426 29837 29837 I syslog  : sshd - Server listening on :: port 22.
07-05 16:35:56.427 29837 29837 I syslog  : sshd - Server listening on 0.0.0.0 port 22.
07-05 16:36:02.759 29850 29850 I syslog  : /data/data/com.termux/files/usr/bin/sshd - Connection closed by authenticating user root 192.168.1.11 port 36404
ssh [email protected] -v

debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Trying private key: /home/chillaranand/.ssh/id_dsa
debug1: Trying private key: /home/chillaranand/.ssh/id_ecdsa
debug1: Trying private key: /home/chillaranand/.ssh/id_ed25519
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: No more authentication methods to try.
Permission denied (publickey,keyboard-interactive).

chmod 600 ~/.ssh/authorized_keys

It won't work with the permissions you have for security reasons.

@ShawnMilo I set permissions correctly. Still it is throwing same error.

chmod 700 $HOME/.ssh
chmod 600 $HOME/.ssh/authorized_keys

I have enabled PasswordAuthentication in /data/data/com.termux/files/usr/etc/ssh/sshd_config and restarted sshd. Anybody knows the default password for ssh?

syslog showed permission errors. After fixing those, its is working. Thanks for the help.

PasswordAuthentication is not supported

@ChillarAnand what error showed on syslog? What did you fix?

I've tried this tutorial
https://glow.li/technology/2016/09/20/access-termux-via-usb.html
but always got

Permission denied (publickey,keyboard-interactive).

@azulkipli You need to copy the content of id_rsa.pub from your computer and add it to the device's ~/.ssh/authorized_keys

Was this page helpful?
0 / 5 - 0 ratings