Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unrecognized import path "golang.org/x/crypto/ssh/terminal" #105

Closed
EncoderPtd opened this issue Apr 11, 2018 · 5 comments
Closed

unrecognized import path "golang.org/x/crypto/ssh/terminal" #105

EncoderPtd opened this issue Apr 11, 2018 · 5 comments

Comments

@EncoderPtd
Copy link

I'm new for GO...

When i execute go get github.com/zmap/zgrab2 it shows:

package golang.org/x/crypto/ssh/terminal: unrecognized import path "golang.org/x/crypto/ssh/terminal" (https fetch: Get https://golang.org/x/crypto/ssh/terminal?go-get=1: dial tcp 216.239.37.1:443: connect: connection refused)
package golang.org/x/sys/unix: unrecognized import path "golang.org/x/sys/unix" (https fetch: Get https://golang.org/x/sys/unix?go-get=1: dial tcp 216.239.37.1:443: connect: connection refused)
package golang.org/x/net/idna: unrecognized import path "golang.org/x/net/idna" (https fetch: Get https://golang.org/x/net/idna?go-get=1: dial tcp 216.239.37.1:443: connect: connection refused)

Is there anything wrong with the git repository path?

And then i try to execute make in ../zgrab2 it shows:

cd cmd/zgrab2 && go build && cd ../..
../../lib/ssh/kex.go:22:2: cannot find package "golang.org/x/crypto/curve25519" in any of:
/home/user/Downloads/Go/go/src/golang.org/x/crypto/curve25519 (from $GOROOT)
/home/user/Code/Go/src/golang.org/x/crypto/curve25519 (from $GOPATH)
../../lib/ssh/keys.go:28:2: cannot find package "golang.org/x/crypto/ed25519" in any of:
/home/user/Downloads/Go/go/src/golang.org/x/crypto/ed25519 (from $GOROOT)
/home/user/Code/Go/src/golang.org/x/crypto/ed25519 (from $GOPATH)
../../lib/smb/ntlmssp/crypto.go:9:2: cannot find package "golang.org/x/crypto/md4" in any of:
/home/user/Downloads/Go/go/src/golang.org/x/crypto/md4 (from $GOROOT)
/home/user/Code/Go/src/golang.org/x/crypto/md4 (from $GOPATH)
../../../../sirupsen/logrus/terminal_check_notappengine.go:9:2: cannot find package "golang.org/x/crypto/ssh/terminal" in any of:
/home/user/Downloads/Go/go/src/golang.org/x/crypto/ssh/terminal (from $GOROOT)
/home/user/Code/Go/src/golang.org/x/crypto/ssh/terminal (from $GOPATH)
../../lib/http/h2_bundle.go:46:2: cannot find package "golang.org/x/net/http2/hpack" in any of:
/home/user/Downloads/Go/go/src/golang.org/x/net/http2/hpack (from $GOROOT)
/home/user/Code/Go/src/golang.org/x/net/http2/hpack (from $GOPATH)
../../../../weppos/publicsuffix-go/publicsuffix/publicsuffix.go:15:2: cannot find package "golang.org/x/net/idna" in any of:
/home/user/Downloads/Go/go/src/golang.org/x/net/idna (from $GOROOT)
/home/user/Code/Go/src/golang.org/x/net/idna (from $GOPATH)
../../lib/http/h2_bundle.go:48:2: cannot find package "golang.org/x/net/lex/httplex" in any of:
/home/user/Downloads/Go/go/src/golang.org/x/net/lex/httplex (from $GOROOT)
/home/user/Code/Go/src/golang.org/x/net/lex/httplex (from $GOPATH)
../../../../sirupsen/logrus/terminal_linux.go:10:8: cannot find package "golang.org/x/sys/unix" in any of:
/home/user/Downloads/Go/go/src/golang.org/x/sys/unix (from $GOROOT)
/home/user/Code/Go/src/golang.org/x/sys/unix (from $GOPATH)
../../lib/http/request.go:30:2: cannot find package "golang.org/x/text/unicode/norm" in any of:
/home/user/Downloads/Go/go/src/golang.org/x/text/unicode/norm (from $GOROOT)
/home/user/Code/Go/src/golang.org/x/text/unicode/norm (from $GOPATH)
../../lib/http/request.go:31:2: cannot find package "golang.org/x/text/width" in any of:
/home/user/Downloads/Go/go/src/golang.org/x/text/width (from $GOROOT)
/home/user/Code/Go/src/golang.org/x/text/width (from $GOPATH)
make: *** [zgrab2] Error 1

@justinbastress
Copy link
Contributor

@EncoderPtd Is this problem unique to zgrab2, or do you get it with all libraries, e.g. go get -u -v golang.org/x/tools/cmd/goimports? If the latter case, it is almost certainly an environment problem.

In any case, my immediate thought is that this may be a problem with your GOROOT environment variable; do you actually have go installed in /home/user/Downloads/Go/go? i.e., if you run which go, does it return /home/user/Downloads/Go/go/bin/go?

@EncoderPtd
Copy link
Author

@justinbastress
Thanks all the same. I find it is due to the internet problem, for some reasons i can't access golang.org/x.
So i have to download the repository form github and manually create folders x/tools, x/crypto, etc. Then move the github.com/golang/crypto, etc. to golang.org/x/crypto.
Heart tired :)

@Drjacky
Copy link

Drjacky commented Dec 14, 2018

Then move the github.com/golang/crypto, etc. to golang.org/x/crypto.

@EncoderPtd Where is this golang.org/x/crypto located?
I've created it under /usr/local/go/src/HERE and /usr/local/go/HERE but still get errors!

@aminNazarii
Copy link

@EncoderPtd
I fix that by go get

@EncoderPtd
Copy link
Author

@Drjacky E... I meant i can't access https://golang.org , the website.
If you can access it, then just follow the official doc is ok, i think.
If you've installed go successfully, the golang.org/x/crypto folder is under GOHOME or somewhere the go get command download resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants