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

scp does not work on a ipv6 host #2753

Open
enko opened this issue Jun 3, 2019 · 3 comments
Open

scp does not work on a ipv6 host #2753

enko opened this issue Jun 3, 2019 · 3 comments

Comments

@enko
Copy link

enko commented Jun 3, 2019

What happened:

I try to download a file via scp and it fails with a empty error message. This only happens on a ipv6 host, if I use an ipv4 host it works like a charm. It does not matter if I use the web interface or the tsh client, the result is the same.

What you expected to happen:

The file should be downloaded.

How to reproduce it (as minimally and precisely as possible):

Run a node on ipv6 and try to use tsh scp to download a file.

Environment:

  • Teleport version (use teleport version): 3.2.4
  • Tsh version (use tsh version): 3.2.4
  • OS (e.g. from /etc/os-release): Debian Stretch on the Server and Manjaro on the Client

Relevant Debug Logs If Applicable

➜ tsh scp --debug --login=ubuntu deployment.cd.int.flyacts.com:/home/ubuntu/.bashrc .                                                                                                            
INFO [CLIENT]    [KEY AGENT] Connected to the system agent: "/tmp/ssh-Qlytkr9Duiba/agent.1332" client/api.go:1947
DEBU [KEYSTORE]  Returning SSH certificate "/home/tschumacher/.tsh/keys/teleport.it.int.flyacts.com/tsc-cert.pub" valid until "2019-06-03 21:48:31 +0200 CEST", TLS certificate "/home/tschumacher/.tsh/keys/teleport.it.int.flyacts.com/tsc-x509.pem" valid until "2019-06-03 19:48:31 +0000 UTC" client/keystore.go:253
INFO [KEYAGENT]  Loading key for "tsc" client/keyagent.go:105
INFO [CLIENT]    Connecting to proxy to copy (recursively=false)... client/api.go:1146
INFO [CLIENT]    Connecting proxy=teleport.it.int.flyacts.com:3023 login='ubuntu' method=0 client/api.go:1444
DEBU [KEYAGENT]  Got 3 known hosts client/keyagent.go:263
DEBU [KEYAGENT]  Verified host teleport.it.int.flyacts.com:3023 client/keyagent.go:316
INFO [CLIENT]    Successful auth with proxy teleport.it.int.flyacts.com:3023 client/api.go:1435
DEBU [CLIENT]    Found clusters: [{"name":"hypervisor1.it.int.flyacts.com","lastconnected":"2019-06-03T10:08:03.523984887+02:00","status":"online"},{"name":"hypervisor1.cd.int.flyacts.com","lastconnected":"2019-06-03T10:08:00.555790482+02:00","status":"online"}] client/client.go:102
INFO [CLIENT]    Client= connecting to node=deployment.cd.int.flyacts.com:0@default@hypervisor1.it.int.flyacts.com client/client.go:355
DEBU [KEYAGENT]  Got 3 known hosts client/keyagent.go:263
DEBU [KEYAGENT]  Verified host deployment.cd.int.flyacts.com:0@default@hypervisor1.it.int.flyacts.com client/keyagent.go:316

ERROR REPORT:
Original Error: *ssh.ExitError Process exited with status 1
Stack Trace:
        /gopath/src/github.com/gravitational/teleport/lib/client/client.go:598 github.com/gravitational/teleport/lib/client.(*NodeClient).ExecuteSCP
        /gopath/src/github.com/gravitational/teleport/lib/client/api.go:1248 github.com/gravitational/teleport/lib/client.(*TeleportClient).SCP
        /gopath/src/github.com/gravitational/teleport/tool/tsh/tsh.go:760 main.onSCP
        /gopath/src/github.com/gravitational/teleport/tool/tsh/tsh.go:316 main.Run
        /gopath/src/github.com/gravitational/teleport/tool/tsh/tsh.go:168 main.main
        /opt/go/src/runtime/proc.go:210 runtime.main
        /opt/go/src/runtime/asm_amd64.s:1334 runtime.goexit
User Message: 
➜ tsh ls --cluster hypervisor1.cd.int.flyacts.com                                    
Node Name                       Address                            Labels         
------------------------------- ---------------------------------- -------------- 
deployment.cd.int.flyacts.com   [2a01:4f8:10b:2753:3:100:0:4]:3022 environment=cd 
hypervisor1.cd.int.flyacts.com  94.130.160.103:3022                environment=cd 

Educated Guess

I think this could happen because the address is not escaped properly or is not put in square brackets. I could provide inside if you could tell me to how to enable the logging in https://github.com/gravitational/teleport/blob/master/lib/sshutils/scp/scp.go#L177.

@benarent
Copy link
Contributor

benarent commented Aug 5, 2019

@enko We've recently fixed working with IPv6. #2867 You can wait until the next build, or build from master to see if this resolves this issue for you.

@capnspacehook
Copy link
Contributor

@benarent can this issue be closed?

@DavidJLambert
Copy link

In addition to putting the IPv6 address inside of square brackets, at least in powershell on windows, the letters in the IPv6 address must be uppercase.

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

No branches or pull requests

5 participants