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 regression on 6.0.0-rc.1 #5695

Closed
webvictim opened this issue Feb 24, 2021 · 0 comments · Fixed by #5729
Closed

scp regression on 6.0.0-rc.1 #5695

webvictim opened this issue Feb 24, 2021 · 0 comments · Fixed by #5729
Assignees
Labels
bug regression test-plan-problem Issues which have been surfaced by running the manual release test plan

Comments

@webvictim
Copy link
Contributor

webvictim commented Feb 24, 2021

Description

What happened:

# build/teleport is a binary
$ ls -l build/teleport
-rwxr-xr-x. 1 gus gus 70682783 Feb 24 17:23 build/teleport

# try to scp it to hades (node running 6.0.0-rc.1), it fails with this weird error
$ scp build/teleport hades:~/tmp
ERROR:
	open home/gus/tmp: no such file or directory

lost connection

# try to scp it to zeus (5.1.2) with the same command, works
$ scp build/teleport zeus:~/tmp
teleport                                                                                                                    100%   67MB  14.6MB/s   00:04

# file was created as expected
$ ssh zeus -- ls -l tmp
-rwxr-xr-x 1 gus gus 70682783 Feb 24 17:29 tmp

# same happens with `tsh scp` to hades, same error in the teleport logs
$ tsh scp build/teleport hades:~/tmp
-> build/teleport (70682783)
error: Process exited with status 1

# tsh scp works to zeus
$ tsh scp build/teleport zeus:~/tmp
-> build/teleport (70682783)

Not sure why the home/gus/tmp is missing the preceding / in the error.

Teleport logs from hades:

Feb 24 17:32:25 hades teleport[1830443]: DEBU [NODE]      Handling request exec, want reply true. id:13 local:192.168.64.201:55646 login:gus remote:192.168.64.1:57146 teleportUser:webvictim regular/sshserver.go:1269
Feb 24 17:32:25 hades teleport[1830443]: INFO [NODE]      Creating (exec) session ff83677f-df42-4cf0-87cf-7fb8b9654f61. id:13 local:192.168.64.201:55646 login:gus remote:192.168.64.1:57146 teleportUser:webvictim srv/sess.go:234
Feb 24 17:32:25 hades teleport[1830443]: DEBU [SESSION:N] Using async streamer for session ff83677f-df42-4cf0-87cf-7fb8b9654f61. srv/sess.go:1043
Feb 24 17:32:25 hades teleport[1830443]: INFO [AUDIT]     session.start addr.remote:192.168.64.1:57146 cluster_name:teleport.example.com code:T2000I ei:0 event:session.start login:gus namespace:default server_addr:192.168.64.201:55646 server_hostname:hades server_id:0065053d-e8e9-4880-aebb-e2d9499b681e server_labels:map[arch:x86_64 external_ipv4:142.167.142.235 external_ipv6:No IPv6 hostname:hades running_containers:alertmanager caddy cadvisor delugevpn grafana homebridge jackett lidarr nodeexporter nodered ombi plex plexpy prometheus pushgateway radarr sensorexporter smokeping sonarr watchtower stopped_containers: teleport_version:Teleport v6.0.0-rc.1 git:v6.0.0-rc.1-0-g5470bb912 go1.15.5 type:node] sid:ff83677f-df42-4cf0-87cf-7fb8b9654f61 time:2021-02-24T21:32:25.464Z uid:5435bd13-0028-41d8-83fa-cdca81ab9c32 user:webvictim events/emitter.go:317
Feb 24 17:32:25 hades teleport[1830443]: INFO [NODE]      Started local command execution: "/usr/local/bin/teleport scp --remote-addr=192.168.64.1:57146 --local-addr=192.168.64.201:55646 -t ~/tmp" id:13 local:192.168.64.201:55646 login:gus remote:192.168.64.1:57146 teleportUser:webvictim srv/exec.go:182
Feb 24 17:32:25 hades teleport[1830443]: INFO [SESSION:N] Closing session ff83677f-df42-4cf0-87cf-7fb8b9654f61. srv/sess.go:632
Feb 24 17:32:25 hades teleport[1830443]: ERROR:
Feb 24 17:32:25 hades teleport[1830443]:         open home/gus/tmp: no such file or directory
Feb 24 17:32:25 hades teleport[1830443]: DEBU [NODE]      Local command failed: exit status 1. id:13 local:192.168.64.201:55646 login:gus remote:192.168.64.1:57146 teleportUser:webvictim srv/exec.go:196
Feb 24 17:32:25 hades teleport[1830443]: DEBU [NODE]      Exec request ("/usr/local/bin/teleport scp --remote-addr=192.168.64.1:57146 --local-addr=192.168.64.201:55646 -t ~/tmp") complete: 1 id:13 local:192.168.64.201:55646 login:gus remote:192.168.64.1:57146 teleportUser:webvictim regular/sshserver.go:1249
Feb 24 17:32:25 hades teleport[1830443]: INFO [AUDIT]     scp action:upload addr.local:192.168.64.201:55646 addr.remote:192.168.64.1:57146 cluster_name:teleport.example.com code:T3005E command:/usr/local/bin/teleport scp --remote-addr=192.168.64.1:57146 --local-addr=192.168.64.201:55646 -t ~/tmp ei:0 event:scp exitCode:1 exitError:exit status 1 login:gus namespace:default path:~/tmp server_id:0065053d-e8e9-4880-aebb-e2d9499b681e sid:ff83677f-df42-4cf0-87cf-7fb8b9654f61 time:2021-02-24T21:32:25.556Z uid:68fb14f6-5b5a-4915-8e32-9aac0abe8853 user:webvictim events/emitter.go:317
Feb 24 17:32:25 hades teleport[1830443]: DEBU [SSH:NODE]  Closed connection 192.168.64.1:57146. sshutils/server.go:448
Feb 24 17:32:25 hades teleport[1830443]: INFO [AUDIT]     session.data addr.remote:192.168.64.1:57146 cluster_name: code:T2006I ei:2.147483646e+09 event:session.data login:gus namespace:default rx:3822 server_id:0065053d-e8e9-4880-aebb-e2d9499b681e sid:ff83677f-df42-4cf0-87cf-7fb8b9654f61 time:2021-02-24T21:32:25.56Z tx:5463 uid:32822ba3-8323-4aec-a2ab-22911882acec user:webvictim events/emitter.go:317

Also note weird line break in the error message.

What you expected to happen: scp to hades should work just as it does to zeus.

Reproduction Steps

See above.

Here's my ~/.ssh/config if it helps:

Host teleport.example.com
    User gus
    Port 3023
    IdentityFile ~/.tsh/keys/teleport.example.com/webvictim
    UserKnownHostsFile ~/.ssh/teleport/known_hosts

Host hades
    User gus
    ProxyCommand sh -c '~/.ssh/teleport/login.sh teleport.example.com webvictim && ssh teleport.example.com -s proxy:%h:%p'
    Port 3022
    IdentityFile ~/.tsh/keys/teleport.example.com/webvictim
    HostKeyAlias hades.teleport.example.com
    UserKnownHostsFile ~/.ssh/teleport/known_hosts

Host zeus
    User gus
    ProxyCommand sh -c '~/.ssh/teleport/login.sh teleport.example.com webvictim && ssh teleport.example.com -s proxy:%h:%p'
    Port 3022
    IdentityFile ~/.tsh/keys/teleport.example.com/webvictim
    HostKeyAlias zeus.teleport.example.com
    UserKnownHostsFile ~/.ssh/teleport/known_hosts

(there are more details about the exact setup at

Server Details

  • Teleport version (run teleport version):
$ ssh hades -- teleport version
Teleport v6.0.0-rc.1 git:v6.0.0-rc.1-0-g5470bb912 go1.15.5

$ ssh zeus -- teleport version
Teleport v5.1.2 git:v5.1.2-0-g822d10b44 go1.15.5
  • tsh version: Teleport v5.1.2 git:v5.1.2-0-g822d10b44 go1.15.5
  • Server OS (e.g. from /etc/os-release): Fedora 32
  • Where are you running Teleport? (e.g. AWS, GCP, Dedicated Hardware): Home lab
@webvictim webvictim added the test-plan-problem Issues which have been surfaced by running the manual release test plan label Feb 24, 2021
a-palchikov added a commit that referenced this issue Feb 26, 2021
Handle target directory/file renames.

Fixes #5695.
a-palchikov added a commit that referenced this issue Feb 26, 2021
a-palchikov added a commit that referenced this issue Mar 2, 2021
Handle target directory/file renames.

Fixes #5695.
a-palchikov added a commit that referenced this issue Mar 2, 2021
russjones pushed a commit that referenced this issue Mar 2, 2021
russjones pushed a commit that referenced this issue Mar 4, 2021
Handle target directory/file renames.

Fixes #5695.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug regression test-plan-problem Issues which have been surfaced by running the manual release test plan
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants