Closed sverhoeven closed 6 years ago
The xenon filesystem sftp copy
command allows to give a --target-location
which could contain a via host.
When source and target both have vias, for example
xenon filesystem sftp \
--location 'sourcehost via:sourcegatewaynode' \
--username sourcehost_user
--via-username gatewaynode_user
copy
--target-location 'targethost via:targetgatewaynode' \
--target-user targethost_user
/file/on/sourcehost /file/on/targethost
The username for the sourcegatewaynode
and targetgatewaynode
should be gatewaynode_user
.
Instead of a single --via-username username
we could also use any number of --via-username hostport=username
.
Where hostport should match the via in the somehost via:hostport
location.
The --username username
option can than be used as the default cred inside CredentialMap.
The copy command will then be
xenon filesystem sftp \
--location 'sourcehost via:sourcegatewaynode' \
--username sourcehost_user
--via-username sourcegatewaynode=sourcegatewaynode_user
--via-username targetgatewaynode=targetgatewaynode_user
copy
--target-location 'targethost via:targetgatewaynode' \
--target-user targethost_user
/file/on/sourcehost /file/on/targethost
This maps much more nicer to the CredentialMap class as the location does not have to be parsed, so going for this functionality.
Xenon now supports a via in the location string, CLI should to.
Using default credentials:
To use different username than local, both the via and end host use
someone
as username.To use different password/passphrase and certfile than local for via and end host use
--password
and--certfile
resp.To use different username than the end host.
To use different password/passphrase and certfile on via node use
--via-password
and--via-certfile
resp.Using single set of
--via-*
for credentials, will allow CLI to only support one cred for the end host and optionally one cred for all via hosts.