francoismichel / ssh3

SSH3: faster and rich secure shell using HTTP/3, checkout our article here: https://arxiv.org/abs/2312.08396 and our Internet-Draft: https://datatracker.ietf.org/doc/draft-michel-ssh3/
https://arxiv.org/abs/2312.08396
Apache License 2.0
3.27k stars 82 forks source link

Unable to install on Termux #119

Open CodeIter opened 8 months ago

CodeIter commented 8 months ago

Hello, I hope you're doing well.

I encountered an issue while trying to install ssh3 on Termux(aarch64) using the provided installation command(go install github.com/francoismichel/ssh3/cmd/...@latest), the installation fails with the following error:

fatal error: 'shadow.h' file not found

Complete Output on Termux

``` go: downloading github.com/francoismichel/ssh3 v0.1.6 go: downloading github.com/kevinburke/ssh_config v1.2.0 go: downloading github.com/quic-go/quic-go v0.40.1-0.20240102075208-1083d1fb8f98 go: downloading github.com/rs/zerolog v1.31.0 go: downloading golang.org/x/crypto v0.17.0 go: downloading github.com/caddyserver/certmagic v0.20.0 go: downloading github.com/creack/pty v1.1.18 go: downloading go.uber.org/zap v1.24.0 go: downloading github.com/coreos/go-oidc/v3 v3.7.0 go: downloading golang.org/x/oauth2 v0.13.0 go: downloading golang.org/x/term v0.15.0 go: downloading github.com/golang-jwt/jwt/v5 v5.0.0 go: downloading golang.org/x/exp v0.0.0-20221205204356-47842c84f3db go: downloading github.com/klauspost/cpuid/v2 v2.2.5 go: downloading github.com/libdns/libdns v0.2.1 go: downloading github.com/mholt/acmez v1.2.0 go: downloading github.com/miekg/dns v1.1.55 go: downloading github.com/zeebo/blake3 v0.2.3 go: downloading golang.org/x/net v0.17.0 go: downloading github.com/quic-go/qpack v0.4.0 go: downloading golang.org/x/sys v0.15.0 go: downloading go.uber.org/atomic v1.11.0 go: downloading go.uber.org/multierr v1.11.0 go: downloading github.com/go-jose/go-jose/v3 v3.0.1 go: downloading github.com/mattn/go-isatty v0.0.19 go: downloading golang.org/x/text v0.14.0 # github.com/francoismichel/ssh3/util/unix_util ../../go/pkg/mod/github.com/francoismichel/ssh3@v0.1.6/util/unix_util/linux_user.go:11:10: fatal error: 'shadow.h' file not found 11 | #include | ^~~~~~~~~~ 1 error generated. ```

Attempted to resolve the issue by creating a proot-distro Alpine Linux environment using:

proot-distro install --override-alias alpine1 alpine
proot-distro login alpine1 --isolated

But, The installation still fails with the following error:

undefined: userPasswordAuthentication
undefined: passwordAuthAvailable
Complete Output on Termux using proot-distro command

``` go: downloading github.com/francoismichel/ssh3 v0.1.6 go: downloading github.com/creack/pty v1.1.18 go: downloading github.com/quic-go/quic-go v0.40.1-0.20240102075208-1083d1fb8f98 go: downloading github.com/rs/zerolog v1.31.0 go: downloading github.com/caddyserver/certmagic v0.20.0 go: downloading go.uber.org/zap v1.24.0 go: downloading github.com/kevinburke/ssh_config v1.2.0 go: downloading golang.org/x/crypto v0.17.0 go: downloading github.com/golang-jwt/jwt/v5 v5.0.0 go: downloading golang.org/x/exp v0.0.0-20221205204356-47842c84f3db go: downloading github.com/klauspost/cpuid/v2 v2.2.5 go: downloading github.com/libdns/libdns v0.2.1 go: downloading github.com/mholt/acmez v1.2.0 go: downloading github.com/miekg/dns v1.1.55 go: downloading github.com/zeebo/blake3 v0.2.3 go: downloading golang.org/x/net v0.17.0 go: downloading github.com/mattn/go-colorable v0.1.13 go: downloading github.com/coreos/go-oidc/v3 v3.7.0 go: downloading golang.org/x/oauth2 v0.13.0 go: downloading golang.org/x/term v0.15.0 go: downloading go.uber.org/atomic v1.11.0 go: downloading go.uber.org/multierr v1.11.0 go: downloading golang.org/x/sys v0.15.0 go: downloading github.com/quic-go/qpack v0.4.0 go: downloading github.com/go-jose/go-jose/v3 v3.0.1 go: downloading github.com/mattn/go-isatty v0.0.19 go: downloading golang.org/x/text v0.14.0 # github.com/francoismichel/ssh3/util/unix_util go/pkg/mod/github.com/francoismichel/ssh3@v0.1.6/util/unix_util/user.go:20:9: undefined: getUser go/pkg/mod/github.com/francoismichel/ssh3@v0.1.6/util/unix_util/user.go:87:9: undefined: userPasswordAuthentication go/pkg/mod/github.com/francoismichel/ssh3@v0.1.6/util/unix_util/user.go:91:9: undefined: passwordAuthAvailable localhost:~# echo error $? error 1 ```

CodeIter commented 8 months ago

I tried again with https://github.com/Questandachievement7Developer/UnifiedContainer , but it falls, this time at github.com/quic-go/quic-go mod with error package net/netip is not in GOROOT.

Script to Reproduce:


git clone --depth=1 https://github.com/Questandachievement7Developer/UnifiedContainer ~/UnifiedContainer.git
cd ~/UnifiedContainer.git/
bash build.sh
cd build/
./UnifiedContainer_*
./unifyServer add container1
./unifyServer launch container1
./unifyServer exec container1 'apk add go ; go install github.com/francoismichel/ssh3/cmd/...@latest || echo error $? ; go version ; uname -a '
complete output

``` (1/2) Installing binutils-gold (2.37-r3) (2/2) Installing go (1.17.10-r0) Executing busybox-1.34.1-r7.trigger OK: 645 MiB in 69 packages go: downloading github.com/francoismichel/ssh3 v0.1.6 go: downloading github.com/creack/pty v1.1.18 go: downloading github.com/caddyserver/certmagic v0.20.0 go: downloading github.com/quic-go/quic-go v0.40.1-0.20240102075208-1083d1fb8f98 go: downloading github.com/rs/zerolog v1.31.0 go: downloading go.uber.org/zap v1.24.0 go: downloading github.com/kevinburke/ssh_config v1.2.0 go: downloading golang.org/x/crypto v0.17.0 go: downloading github.com/golang-jwt/jwt/v5 v5.0.0 go: downloading golang.org/x/exp v0.0.0-20221205204356-47842c84f3db go: downloading github.com/klauspost/cpuid/v2 v2.2.5 go: downloading github.com/libdns/libdns v0.2.1 go: downloading github.com/mholt/acmez v1.2.0 go: downloading github.com/miekg/dns v1.1.55 go: downloading github.com/zeebo/blake3 v0.2.3 go: downloading golang.org/x/net v0.17.0 go: downloading github.com/coreos/go-oidc/v3 v3.7.0 go: downloading golang.org/x/oauth2 v0.13.0 go: downloading golang.org/x/term v0.15.0 go: downloading github.com/mattn/go-colorable v0.1.13 go: downloading go.uber.org/atomic v1.11.0 go: downloading go.uber.org/multierr v1.11.0 go: downloading github.com/quic-go/qpack v0.4.0 go: downloading golang.org/x/sys v0.15.0 go: downloading github.com/mattn/go-isatty v0.0.19 go: downloading github.com/go-jose/go-jose/v3 v3.0.1 go: downloading golang.org/x/text v0.14.0 go/pkg/mod/github.com/quic-go/quic-go@v0.40.1-0.20240102075208-1083d1fb8f98/sys_conn_helper_linu x.go:8:2: package net/netip is not in GOROOT (/usr/lib/go/src/net/netip) error 1 go version go1.17.10 linux/arm64 Linux localhost UnifiedContainer-IsolationKernelLauncher-rev30 #1 SMP PREEMPT Tue Sep 26 09:13:5 8 UTC 2023 aarch64 Linux ```

francoismichel commented 8 months ago

Hi !

Thank for all the debug infos.

I see two errors there: 1) There is no shadow passwords in Termux, it thus won't be able compile the server if built with password auth. Either you just need the client and it should therefore work with the following command: go install github.com/francoismichel/ssh3/cmd/ssh3@latest. If you need the server, you can compile it by setting the disable_password_auth build tag when building/installing (-tags disable_password_auth)

2) On your second try, it shows the go version is 1.17. quic-go and therefore this project require go version 1.21 or newer for compiling.

Does it help ?

CodeIter commented 8 months ago

Yes, thank you. I just need the client on Termux.