disabling local-to-local transfers?
Eloi Benoist-Vanderbeken
eloi.benoist-vanderbeken at synacktiv.com
Mon Jul 27 18:08:10 AEST 2026
Hi,
My two cents: there is probably several scripts using scp for both remote and local copies. I'm sure I've already did that to be able to deploy things both locally and remotely depending on an argument, it saves an if.
Breaking them doesn't sound like a good idea. If disabling local-to-local transfers becomes an option, it should be "opt-in".
--
Eloi Benoist-Vanderbeken
Synacktiv
+33 (0)6 67 92 63 35
-----Original Message-----
From: Philipp Marek via openssh-unix-dev <openssh-unix-dev at mindrot.org>
Reply-To: Philipp Marek <philipp at marek.priv.at>
To: Brian Candler <b.candler at pobox.com>
Cc: openssh-unix-dev at mindrot.org
Subject: Re: disabling local-to-local transfers?
Date: 07/27/2026 07:30:45 AM
> 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.)
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev at mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
More information about the openssh-unix-dev
mailing list