fix: ipv6 scp should use -6 flag
This commit is contained in:
@@ -94,7 +94,9 @@ class SshMultiplexingHelper
|
|||||||
$muxPersistTime = config('constants.ssh.mux_persist_time');
|
$muxPersistTime = config('constants.ssh.mux_persist_time');
|
||||||
|
|
||||||
$scp_command = "timeout $timeout scp ";
|
$scp_command = "timeout $timeout scp ";
|
||||||
|
if ($server->isIpv6()) {
|
||||||
|
$scp_command .= '-6 ';
|
||||||
|
}
|
||||||
if (self::isMultiplexingEnabled()) {
|
if (self::isMultiplexingEnabled()) {
|
||||||
$scp_command .= "-o ControlMaster=auto -o ControlPath=$muxSocket -o ControlPersist={$muxPersistTime} ";
|
$scp_command .= "-o ControlMaster=auto -o ControlPath=$muxSocket -o ControlPersist={$muxPersistTime} ";
|
||||||
self::ensureMultiplexedConnection($server);
|
self::ensureMultiplexedConnection($server);
|
||||||
|
@@ -1221,4 +1221,9 @@ $schema://$host {
|
|||||||
|
|
||||||
return instant_remote_process($commands, $this, false);
|
return instant_remote_process($commands, $this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isIpv6(): bool
|
||||||
|
{
|
||||||
|
return str($this->ip)->contains(':');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user