juju scp does not preserve original ownership, permissions

Bug #2019753 reported by Leon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Medium
Jack Shaw

Bug Description

Just noticed that after `juju scp`, ownership changes from root to e.g. 1000. Not sure if this is necessarily a bug.
I didn't see a "preserve" option like regular scp has.

root@cc-0:/var/lib/juju/agents/unit-cc-0/charm# ls src -l
total 40
-rwxr-xr-x 1 root root 17205 May 15 18:17 charm.py # BEFORE
-rwxrwxr-x 1 1000 1000 17762 May 15 18:23 charm.py # AFTER

Tags: juju-scp
Leon (sed-i)
description: updated
Revision history for this message
Vitaly Antonenko (anvial) wrote :

Hi Leon,

Which version of Juju are you using?

I believe that `juju scp` just repeats the behavior of `scp`.

Revision history for this message
Leon (sed-i) wrote :

scp has a "preserve" option

```
-p Preserves modification times, access times, and file mode bits from the source file.
```

that I did not see for juju scp (2.9.42-ubuntu-amd64).

Revision history for this message
Leon (sed-i) wrote :

Just noticed it says "source file", not "destination file".
For "juju scp" from host into container I'd like to be able to preserve props of destination file.

Again, this is not too critical. More of a question about design's intent than a request.

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 2019753] Re: juju scp does not preserve original ownership, permissions

Note that `juju scp` for K8s *doesn't* invoke scp itself, because there is
no ssh agent running inside of containers. So we have to approximate it
with the equivalent K8s api requests (my understanding is that it is
roughly equivalent to kubectl exec commands.)

I don't know the details for how we emulate scp, it is probably worth
having some similar behaviors there.

On Thu, May 18, 2023 at 10:16 PM Leon <email address hidden> wrote:

> Just noticed it says "source file", not "destination file".
> For "juju scp" from host into container I'd like to be able to preserve
> props of destination file.
>
> Again, this is not too critical. More of a question about design's
> intent than a request.
>
> --
> You received this bug notification because you are subscribed to
> Canonical Juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/2019753
>
> Title:
> juju scp does not preserve original ownership, permissions
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/2019753/+subscriptions
>
>

Changed in juju:
importance: Undecided → Medium
status: New → Triaged
tags: added: juju-scp
Changed in juju:
assignee: nobody → Jack Shaw (jack-shaw)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.