disabling local-to-local transfers?
Philipp Marek
philipp at marek.priv.at
Mon Jul 27 15:30:45 AEST 2026
> It does add "-p" if requested:
...
> Hence:
>
> scp <local1> <local2> should behave identically to cp <local1> <local2>
> scp -p <local1> <local2> should behave identically to cp -p <local1>
> <local2>
>
> which I think satisfies POLS.
Still, my (Debian) manpage says
| -p same as --preserve=mode,ownership,timestamps
and that's what I empirically observe.
> Regarding xattrs, are you saying that scp <local> <remote> preserves
> xattrs but scp <local> <local> does not? That would be an
> inconsistency if it were the case, but I've never needed to test this,
> and I don't see any instance of "xattr" in the openssh-portable source.
My point is: for local use "scp" is only a little bit better than
cat < source > target
With -p it keeps _some_ metadata, but xattrs are lost.
So perhaps it would be less surprising to reject local copies _by
default_ --
missing xattrs might be hard(er) to debug.
That for _remote_ copies xattr are lost, too, is another data-point --
but maybe not that important, as filesystems, OS, etc. differ
in whether they support xattrs at all.
(I wouldn't expect a Linux => some network switch scp to retain xattrs,
nor that AIX understands SELinux values, etc.)
More information about the openssh-unix-dev
mailing list