NyaMisty / sshdog_ios

Small portable SSH server in Go, Supporting iOS TrollStore
https://drafts.misty.moe/trollstore-ssh-6166337d45d6477bb5bd13c3ae63dfe0
Apache License 2.0
54 stars 3 forks source link

exit status 1 / posix_spawnp returned 2 #2

Open SandiyosDev opened 1 year ago

SandiyosDev commented 1 year ago

I've not been able to execute and connect to sshdog in the Filza terminal on iOS; Upon connection, the error "posix_spawnp returned 2" indicates that there was a problem executing sshdog... Below are the error logs:

Client: user@host ~ % ssh root@192.168.0.192 -p 223 root@192.168.0.192's password: 2022/12/28 19:16:35 [DEBUG][SpawnHelper][spawn] posix_spawnp returned 2 2022/12/28 19:16:35 [DEBUG][SpawnHelper]posix_spawnp unexpected exit: posix_spawnp returned 2 Connection to 192.168.0.192 closed.

Server: 2022/12/28 19:16:16 [DEBUG] Setting auth password. 2022/12/28 19:16:16 [DEBUG] Listening on :223 2022/12/28 19:16:16 [DEBUG] Waiting for shutdown. 2022/12/28 19:16:16 [DEBUG] select... 2022/12/28 19:16:21 [DEBUG] Accepted connection from: 192.168.0.219:60911 2022/12/28 19:16:21 [DEBUG] Connection closed by remote host. 2022/12/28 19:16:21 [DEBUG] select... 2022/12/28 19:16:32 [DEBUG] Accepted connection from: 192.168.0.219:60992 2022/12/28 19:16:35 [DEBUG] Authenticated client from: 192.168.0.219:60992 2022/12/28 19:16:35 [DEBUG] select... 2022/12/28 19:16:35 [DEBUG] Incoming channel request: session 2022/12/28 19:16:35 [DEBUG] env: LANG=en_US.UTF-8 2022/12/28 19:16:35 [DEBUG] Executing [/bin/sh] 2022/12/28 19:16:35 [DEBUG][spawn] using spawnHelper! 2022/12/28 19:16:35 [DEBUG][spawn] path: /private/var/mobile/Documents/Ssh/sshdog, args: [/private/var/mobile/Documents/Ssh/sshdog spawn 14 /bin/sh], isSpawn: false, needSpawn: true 2022/12/28 19:16:35 [DEBUG][spawn] setting up posix_spawnattr_init... 2022/12/28 19:16:35 [DEBUG][spawn] setting up posix_spawnattr_setflags: [setsid] 2022/12/28 19:16:35 [DEBUG][spawn] setting up stdin/out files... 2022/12/28 19:16:35 [DEBUG][spawn] setting up posix_spawn_file_actions... 2022/12/28 19:16:35 [DEBUG][spawn] changing directory... 2022/12/28 19:16:35 [DEBUG][spawn] Got spawned pid: 3956 2022/12/28 19:16:35 [DEBUG][SpawnHelper] checking tty fd... 2022/12/28 19:16:35 [DEBUG][SpawnHelper] setting up tty... 2022/12/28 19:16:35 [DEBUG][SpawnHelper] already session leader, not doing setsid 2022/12/28 19:16:35 [DEBUG][SpawnHelper] spawning original program 2022/12/28 19:16:35 [DEBUG][SpawnHelper][spawn] path: /bin/sh, args: [/bin/sh], isSpawn: true, needSpawn: false 2022/12/28 19:16:35 [DEBUG][SpawnHelper][spawn] setting up posix_spawnattr_init... 2022/12/28 19:16:35 [DEBUG][SpawnHelper][spawn] setting up posix_spawnattr_setflags: [setexec] 2022/12/28 19:16:35 [DEBUG][SpawnHelper][spawn] setting up stdin/out files... 2022/12/28 19:16:35 [DEBUG][SpawnHelper][spawn] setting up posix_spawn_file_actions... 2022/12/28 19:16:35 [DEBUG][SpawnHelper][spawn] changing directory... 2022/12/28 19:16:35 [DEBUG] Finished execution. Err: exit status 1 2022/12/28 19:16:35 [DEBUG] Closing session channel. 2022/12/28 19:16:35 [DEBUG] Closing connection to: 192.168.0.219:60992

vadim-a-yegorov commented 1 year ago

This is a solution for Filza Jailed with fish shell:

Create sshdog.sh with contents below and run

set -gx SSHDOG_SHELL (which sh)
./sshdog