<div dir="auto"><div dir="auto">Hello,</div><div dir="auto"><br></div><div dir="auto">I am using dropbear on Android phones to connect to each other. I am using a cross-compiled single file binary of dropbear for Android. I am using the &quot;command=“ option in authorized_keys and also using the public key for auth. The server when started from within my Android app is not allowing the ssh connection to be successful. However, if I run the server from an adb shell, the connection is successful and my command from authorized_keys is executed like a charm. </div><div dir="auto"><br></div><div dir="auto">Dropbear version: Dropbear v2017.75</div><div dir="auto">My phone: Nokia 8.1 (Android 10)</div><div dir="auto">Command to start the server: libdropbear.so -vFp 21210 -r .ssh/id_ecdsa</div><div dir="auto">Location of authorized_keys: /data/user/0/com.batnpad.appname.debug/.ssh/authorized_keys (Permission is 600)</div><div dir="auto">Command used on the client side: ./libdbclient.so -yp 21210 -I 30 -i ../.ssh/id_ecdsa <a href="mailto:u0_a340@192.168.1.142" target="_blank" rel="noreferrer">u0_a340@192.168.1.142</a></div><div dir="auto">Output on the client side in case of failure: ./libdbclient.so: Connection to <a href="http://u0_a340@192.168.1.142:21210" target="_blank" rel="noreferrer">u0_a340@192.168.1.142:21210</a> exited: Remote closed the connection</div><div dir="auto"><br></div><div dir="auto">I checked the verbose server logs in both cases. To keep it concise, I will only paste the lines with a difference:</div><div dir="auto"><br></div><div dir="auto">Log from server started from within the app:</div><div dir="auto">TRACE  (10836) 34.244358: enter checkfileperm(/data/user/0/)</div><div dir="auto">TRACE  (10836) 34.244452: leave checkfileperm: success</div><div dir="auto">TRACE  (10836) 34.244458: enter checkfileperm(/data/user/0//.ssh)</div><div dir="auto">TRACE  (10836) 34.244469: leave checkfileperm: success</div><div dir="auto">TRACE  (10836) 34.244473: enter checkfileperm(/data/user/0//.ssh/authorized_keys)</div><div dir="auto">TRACE  (10836) 34.244485: leave checkfileperm: success</div><div dir="auto">TRACE  (10836) 34.244490: leave checkpubkeyperms</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Log from server started from an adb shell:</div><div dir="auto">TRACE  (10481) 8.908210: enter checkfileperm(/data/user/0/com.batnpad.appname.debug)</div><div dir="auto">TRACE  (10481) 8.908333: leave checkfileperm: success</div><div dir="auto">TRACE  (10481) 8.908346: enter checkfileperm(/data/user/0/com.batnpad.appname.debug/.ssh)</div><div dir="auto">TRACE  (10481) 8.908359: leave checkfileperm: success</div><div dir="auto">TRACE  (10481) 8.908381: enter checkfileperm(/data/user/0/com.batnpad.appname.debug/.ssh/authorized_keys)</div><div dir="auto">TRACE  (10481) 8.908396: leave checkfileperm: success</div><div dir="auto">TRACE  (10481) 8.908402: leave checkpubkeyperms</div><div dir="auto"><br></div><div dir="auto">I have been trying to solve this for days. Any pointers will be of great help. Thanks.</div></div>