For security reasons, I wrote a memorandum because the file exchange when port forwarding and communicating via the bastion server always fails.
First of all, port forwarding. 1234: 1.2.3.4
is the port used for SSH connection and the IP address of the connection destination, and [email protected]
is the user name and IP address of the bastion server to log in to the bastion server. /.Ssh/id_rsa
is the private key path.
ssh -A -L 1234:1.2.3.4 -i /.ssh/id_rsa [email protected]
scp connect.
scp -r -i /.ssh/id_rsa -P 10022 user@localhost:/etc/path/to/file /file/ /local/pc/path
This command transfers the contents of the / etc / path / to / file
directory on the server to / local / pc / path
on the local PC.
It is a list of transfer source location
.
Recommended Posts