1

Following all of the steps outlined in this answer, on the thread titled How to mount Android external storage over WiFi instead of USB, I still can't figure out how to wirelessly mount my Android phone via SSH on Ubuntu 20.04.

After installing SSH/SFTP Server - Terminal on my phone, I can successfully connect to the server via SSH, but am unable to mount it as a filesystem.

When entering the URI ssh://obalaban@192.168.50.13:2222 in Thunar, nothing happens, while when adding the path to the top-level directory, /sdcard, initially the filesystem appears to be mounted, only to open up a blank file named 'sdcard' in a text editor at the putative mount point, but nothing actually is mounted.

echo obalaban | sshfs -o password_stdin -p 2222 obalaban@192.168.50.237:/ /mnt/samsung
read: Connection reset by peer

I fixed this error by editing /etc/fuse.conf and enabling the line user_allow_other.

I am using public key authentication and tried copying my key to the remote filesystem, but was unsuccessful. Normal ssh login works fine. So I tried debugging in sshfs:

sshfs -odebug,sshfs_debug,loglevel=debug -o allow_other,default_permissions -p 2222 obalaban@192.168.50.237:~/ /mnt/samsung
SSHFS version 2.10.0
FUSE library version: 2.9.9
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
executing <ssh> <-x> <-a> <-oClearAllForwardings=yes> <-ologlevel=debug> <-oPort=2222> <-2> <obalaban@192.168.50.237> <-s> <sftp>
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 192.168.50.237 [192.168.50.237] port 2222.
debug1: Connection established.
debug1: identity file /home/obalaban/.ssh/id_rsa type 0
debug1: identity file /home/obalaban/.ssh/id_rsa-cert type -1
debug1: identity file /home/obalaban/.ssh/id_dsa type -1
debug1: identity file /home/obalaban/.ssh/id_dsa-cert type -1
debug1: identity file /home/obalaban/.ssh/id_ecdsa type -1
debug1: identity file /home/obalaban/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/obalaban/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/obalaban/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/obalaban/.ssh/id_ed25519 type -1
debug1: identity file /home/obalaban/.ssh/id_ed25519-cert type -1
debug1: identity file /home/obalaban/.ssh/id_ed25519_sk type -1
debug1: identity file /home/obalaban/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/obalaban/.ssh/id_xmss type -1
debug1: identity file /home/obalaban/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.11
debug1: Remote protocol version 2.0, remote software version SSH Server - Banana Studio
debug1: no match: SSH Server - Banana Studio
debug1: Authenticating to 192.168.50.237:2222 as 'obalaban'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:JD2yGa1+aF6yPMMZpeFGBkMHM5qLhfBo5mRERuyOOT4
debug1: Host '[192.168.50.237]:2222' is known and matches the ECDSA host key.
debug1: Found key in /home/obalaban/.ssh/known_hosts:9
debug1: rekey out after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 4294967296 blocks
debug1: Will attempt key: /home/obalaban/.ssh/id_rsa RSA SHA256:W4wAsxdFXXWQJMU9k54+cHDYrvXrVo9hZEbLXkRySOM
debug1: Will attempt key: /home/obalaban/.ssh/id_dsa 
debug1: Will attempt key: /home/obalaban/.ssh/id_ecdsa 
debug1: Will attempt key: /home/obalaban/.ssh/id_ecdsa_sk 
debug1: Will attempt key: /home/obalaban/.ssh/id_ed25519 
debug1: Will attempt key: /home/obalaban/.ssh/id_ed25519_sk 
debug1: Will attempt key: /home/obalaban/.ssh/id_xmss 
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: password,keyboard-interactive,publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/obalaban/.ssh/id_rsa RSA SHA256:W4wAsxdFXXWQJMU9k54+cHDYrvXrVo9hZEbLXkRySOM
debug1: Authentications that can continue: password,keyboard-interactive,publickey
debug1: Trying private key: /home/obalaban/.ssh/id_dsa
debug1: Trying private key: /home/obalaban/.ssh/id_ecdsa
debug1: Trying private key: /home/obalaban/.ssh/id_ecdsa_sk
debug1: Trying private key: /home/obalaban/.ssh/id_ed25519
debug1: Trying private key: /home/obalaban/.ssh/id_ed25519_sk
debug1: Trying private key: /home/obalaban/.ssh/id_xmss
debug1: Next authentication method: keyboard-interactive
Password authentication
Password: 
debug1: Authentication succeeded (keyboard-interactive).
Authenticated to 192.168.50.237 ([192.168.50.237]:2222).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending subsystem: sftp
Server version: 3
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Transferred: sent 2624, received 1512 bytes, in 0.1 seconds
Bytes per second: sent 29627.5, received 17071.9
debug1: Exit status 0

LostSoul
  • 459
  • 1
  • 5
  • 7

0 Answers0