StanfordSNR / guardian-agent

[beta] Guardian Agent: secure ssh-agent forwarding for Mosh and SSH
BSD 3-Clause "New" or "Revised" License
439 stars 30 forks source link

Can't manage to install on M1 Mac #36

Open fratrik opened 1 year ago

fratrik commented 1 year ago

I followed the brew instructions and got the following

sga-guard <hostname>

doesn't produce any output

Not sure what this one is, but they produce segmentation faults

> sga-guard-bin <hostname>
[1]    62556 segmentation fault  sga-guard-bin <hostname>
> sga-ssh <hostname>
[1]    62609 segmentation fault  sga-ssh <hostname>

I tried downloading go so I could install from source, but could not figure that out.

> go get github.com/StanfordSNR/guardian-agent/...
go: go.mod file not found in current directory or any parent directory.
    'go get' is no longer supported outside a module.
    To build and install a command, use 'go install' with a version,
    like 'go install example.com/cmd@latest'
    For more information, see https://golang.org/doc/go-get-install-deprecation
    or run 'go help get' or 'go help install'.

> go install github.com/StanfordSNR/guardian-agent@latest
go: finding module for package github.com/hashicorp/yamux
go: finding module for package golang.org/x/crypto/ssh/terminal
go: finding module for package golang.org/x/sys/unix
go: finding module for package golang.org/x/crypto/ssh/agent
go: finding module for package github.com/sternhenri/interact
go: finding module for package golang.org/x/crypto/ssh
go: finding module for package github.com/howeyc/gopass
go: finding module for package golang.org/x/crypto/ssh/knownhosts
go: found github.com/hashicorp/yamux in github.com/hashicorp/yamux v0.1.1
go: found github.com/howeyc/gopass in github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef
go: found github.com/sternhenri/interact in github.com/sternhenri/interact v0.0.0-20170607043113-dfeb9ef20304
go: found golang.org/x/crypto/ssh in golang.org/x/crypto v0.5.0
go: found golang.org/x/crypto/ssh/agent in golang.org/x/crypto v0.5.0
go: found golang.org/x/crypto/ssh/knownhosts in golang.org/x/crypto v0.5.0
go: found golang.org/x/crypto/ssh/terminal in golang.org/x/crypto v0.5.0
go: found golang.org/x/sys/unix in golang.org/x/sys v0.4.0
package github.com/StanfordSNR/guardian-agent is not a main package
thearthur commented 1 year ago

I am also having this problem

alvg commented 1 year ago

+1

TTimo commented 1 year ago

This is on Linux (Arch) as well. I am not familiar with go, updated build instructions are needed.

TTimo commented 1 year ago

I got a little further by banging rocks (and doing this: go mod init sga ; go mod tidy ; go mod vendor ; go build)

# sga
./agent.go:54:108: undefined: ssh.Filter
./agent.go:66:33: undefined: knownhosts.OrderHostKeyAlgs
./agent.go:70:20: undefined: ssh.NewProxyConn
./agent.go:141:16: undefined: ssh.NewFilter
./delegated_client.go:608:4: unknown field KexCallback in struct literal of type ssh.Config
./delegated_client.go:611:3: unknown field DeferHostKeyVerification in struct literal of type ssh.ClientConfig
./delegated_client.go:629:44: undefined: ssh.NoMoreSessionRequestName
./delegated_client.go:631:50: undefined: ssh.NoMoreSessionRequestName
./delegated_client.go:634:51: undefined: ssh.NoMoreSessionRequestName
./delegated_client.go:652:14: c.sshClient.RequestKeyChange undefined (type *ssh.Client has no field or method RequestKeyChange)
./delegated_client.go:652:14: too many errors
drewwells commented 1 year ago

So, a standard library was forked for some reason. I'm not really sure why, and there's no tests. It would be challenging to update this to modern go that supports arm. I'm more interested in the underlying library to talk to mosh. It would be interesting to break that out into its own library for importing. As a gui though, it would be better suited to a gui friendly language.

https://github.com/StanfordSNR/crypto/commit/182a8be2f490f88d44c9cdd1fff78f0156c5c7b3

mdella-nutanix commented 10 months ago

Doesn't work using homebrew either for intel Macs. Looking closer it looks like the team just hasn't kept up with the OS releases in general. Is this a dead project? Looking at check ins, it looks like no movement for 3+ years.

lunasophia commented 9 months ago

Sadly, yes, this does appear to be a dead project. The Stanford students working on it have graduated, and the professor leading the project seems to have moved on to other projects as well. Quite a shame, as a mosh developer in mobile-shell/mosh#120 emphatically pointed people here as the One True Solution.

keithw commented 9 months ago

The professor and the Mosh developer are the same person. :-) I think if somebody is willing to take this over, we're interested to hand this over and work with you. I spoke with the original developers (and somebody interested in taking this over) back on Oct. 5 and we were going to work on a transition plan, but I fear intervening events in the Middle East may have taken priority for them. :-(

eggbean commented 8 months ago

I don't use mac, but I use the Nix sga-guardian package for different architectures on Linux and there's one for aarch64-darwin.

If you don't use nix as a package manager, you could try extracting the binaries.

simmel commented 6 months ago

https://github.com/StanfordSNR/guardian-agent/issues/33#issuecomment-1122643170 works for me™

Sadly it doesn't work with Go 1.22 since they removed GO111MODULE=off support for go get but everything I tried below it works.