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

x/crypto/ssh PublicKeys example is failing with key type ssh-rsa not in PubkeyAcceptedAlgorithms error on sshd #47932

Closed
fengye87 opened this issue Aug 24, 2021 · 2 comments

Comments

@fengye87
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.16.6 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/fengye87/.cache/go-build"
GOENV="/home/fengye87/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/fengye87/go/1.16.6/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/fengye87/go/1.16.6"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/fengye87/.goenv/versions/1.16.6"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/fengye87/.goenv/versions/1.16.6/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.6"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/fengye87/workspace/demo/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2394764193=/tmp/go-build -gno-record-gcc-switches"

What did you do?

The x/crypto/ssh PublicKeys example is failing. The client side error is ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain. But the key works perfectly with ssh -i command. There's a sshd error message says userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth].

The key I'm using is generated using plain ssh-keygen. Since ssh -i can work, my guess is that pub.Type() may not be a valid value in this case?

What did you expect to see?

The example should work as expected

What did you see instead?

The example is not working

@gopherbot gopherbot added this to the Unreleased milestone Aug 24, 2021
@toothrot
Copy link
Contributor

What version of openssh do you have installed?

#46569 #37278

@fengye87
Copy link
Author

@toothrot

local:

$ rpm -qa | grep openssh
openssh-server-7.4p1-21.el7.x86_64
openssh-clients-7.4p1-21.el7.x86_64
openssh-7.4p1-21.el7.x86_64

remote:

$ rpm -qa | grep openssh
openssh-8.6p1-3.fc34.x86_64
openssh-clients-8.6p1-3.fc34.x86_64
openssh-server-8.6p1-3.fc34.x86_64

After looking at #37278, I believe this is a dup. I'm closing this. Thanks for the help.

@golang golang locked and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants