无法在 Ubuntu 20.04 上通过 SSH 挂载 Android 手机

无法在 Ubuntu 20.04 上通过 SSH 挂载 Android 手机

按照本文概述的所有步骤回答,在标题为如何通过 WiFi 而不是 USB 安装 Android 外部存储,我仍然不知道如何在 Ubuntu 20.04 上通过 SSH 无线安装我的 Android 手机。

在手机上安装 SSH/SFTP 服务器 - 终端后,我可以通过 SSH 成功连接到服务器,但无法将其作为文件系统挂载。

当在 Thunar 中输入 URI 时,什么也不会发生,而当将路径添加到顶级目录时,最初文件系统似乎已被挂载,只是在假定的挂载点的文本编辑器中打开了一个名为“sdcard”的空白文件,但实际上什么都没有挂载。ssh://[email protected]:2222/sdcard

echo obalaban | sshfs -o password_stdin -p 2222 [email protected]:/ /mnt/samsung
read: Connection reset by peer

我通过编辑 /etc/fuse.conf 并启用该行修复了此错误user_allow_other

我使用公钥身份验证并尝试将密钥复制到远程文件系统,但没有成功。普通 ssh 登录可以正常工作。因此我尝试在 sshfs 中进行调试:

sshfs -odebug,sshfs_debug,loglevel=debug -o allow_other,default_permissions -p 2222 [email protected]:~/ /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> <[email protected]> <-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

相关内容