My local machine and remote machine are both connected to the same network i.e my Android Phone hotspot. I can connect to remote machine by ssh but, the problem is when I am trying to copy some files into remote machine, I am facing error messages, the strange thing is that yesterday scp
was working, but today scp -v file.txt [email protected]:/root
giving following error message:
Executing: program /data/data/com.termux/files/usr/bin/ssh host 191.168.43.85, user root, command scp -v -t /root
OpenSSH_7.7p1, OpenSSL 1.0.2o 27 Mar 2018
debug1: Reading configuration data /data/data/com.termux/files/usr/etc/ssh/ssh_config
debug1: Connecting to 191.168.43.85 [191.168.43.85] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /data/data/com.termux/files/home/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /data/data/com.termux/files/home/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /data/data/com.termux/files/home/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /data/data/com.termux/files/home/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /data/data/com.termux/files/home/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /data/data/com.termux/files/home/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /data/data/com.termux/files/home/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /data/data/com.termux/files/home/.ssh/id_ed25519-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /data/data/com.termux/files/home/.ssh/id_xmss type -1
debug1: key_load_public: No such file or directory
debug1: identity file /data/data/com.termux/files/home/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.7
ssh_exchange_identification: read: Connection reset by peer
lost connection
Here is content of ~/.ssh
folded from local machine
# ls -la .ssh
total 12
drwx------ 2 u0_a334 u0_a334 4096 Jul 25 12:33 .
drwx------ 36 u0_a334 u0_a334 4096 Jul 25 12:05 ..
-rw------- 1 u0_a334 u0_a334 0 Jul 25 12:33 authorized_keys
-rw-r--r-- 1 u0_a334 u0_a334 175 Jul 25 11:51 known_hosts
I checked /etc/hosts.deny
all things are commented so it is not culprit.
Here is content of known_hosts file from local machine
# cat .ssh/known_hosts
192.168.43.85 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBB4scw5vCUl2dssTS97+5QhiMBIk+/Tc15LoqAoS05i99jMOwRwyRpoNcKTk52d5hprkI7ECIGC9Qrh1KcIniFM=
I think it is not duplicate of this Trying to SSH into server and getting key_load_public: No such file or directory error
Because my situation is a little bit different, as I can still control my remote machine, by means of ssh [email protected]
. By the way I tried all solutions from Trying to SSH into server and getting key_load_public: No such file or directory error
Edit
After generating private keys everything is working fine but still I am confused why scp was working without private keys.
ls -la /data/data/com.termux/files/home/.ssh/
ssh [email protected] echo hello
work?